Skip to content

Commit 914f92d

Browse files
authored
Bump Ruff to the latest version (#2073)
Makes the code look nicer <!-- Thanks for opening a pull request! --> <!-- In the case this PR will resolve an issue, please replace ${GITHUB_ISSUE_ID} below with the actual Github issue id. --> <!-- Closes #${GITHUB_ISSUE_ID} --> # Rationale for this change # Are these changes tested? # Are there any user-facing changes? <!-- In the case of user-facing changes, please add the changelog label. -->
1 parent 131dd15 commit 914f92d

File tree

7 files changed

+282
-282
lines changed

7 files changed

+282
-282
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ repos:
2727
- id: check-yaml
2828
- id: check-ast
2929
- repo: https://github.com/astral-sh/ruff-pre-commit
30-
rev: v0.8.6
30+
rev: v0.11.13
3131
hooks:
3232
- id: ruff
3333
args: [ --fix, --exit-non-zero-on-fix ]

tests/catalog/test_rest.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -323,19 +323,19 @@ def test_properties_sets_headers(requests_mock: Mocker) -> None:
323323
**{"header.Content-Type": "application/vnd.api+json", "header.Customized-Header": "some/value"},
324324
)
325325

326-
assert (
327-
catalog._session.headers.get("Content-type") == "application/json"
328-
), "Expected 'Content-Type' default header not to be overwritten"
329-
assert (
330-
requests_mock.last_request.headers["Content-type"] == "application/json"
331-
), "Config request did not include expected 'Content-Type' header"
326+
assert catalog._session.headers.get("Content-type") == "application/json", (
327+
"Expected 'Content-Type' default header not to be overwritten"
328+
)
329+
assert requests_mock.last_request.headers["Content-type"] == "application/json", (
330+
"Config request did not include expected 'Content-Type' header"
331+
)
332332

333-
assert (
334-
catalog._session.headers.get("Customized-Header") == "some/value"
335-
), "Expected 'Customized-Header' header to be 'some/value'"
336-
assert (
337-
requests_mock.last_request.headers["Customized-Header"] == "some/value"
338-
), "Config request did not include expected 'Customized-Header' header"
333+
assert catalog._session.headers.get("Customized-Header") == "some/value", (
334+
"Expected 'Customized-Header' header to be 'some/value'"
335+
)
336+
assert requests_mock.last_request.headers["Customized-Header"] == "some/value", (
337+
"Config request did not include expected 'Customized-Header' header"
338+
)
339339

340340

341341
def test_config_sets_headers(requests_mock: Mocker) -> None:
@@ -352,19 +352,19 @@ def test_config_sets_headers(requests_mock: Mocker) -> None:
352352
catalog = RestCatalog("rest", uri=TEST_URI, warehouse="s3://some-bucket")
353353
catalog.create_namespace(namespace)
354354

355-
assert (
356-
catalog._session.headers.get("Content-type") == "application/json"
357-
), "Expected 'Content-Type' default header not to be overwritten"
358-
assert (
359-
requests_mock.last_request.headers["Content-type"] == "application/json"
360-
), "Create namespace request did not include expected 'Content-Type' header"
355+
assert catalog._session.headers.get("Content-type") == "application/json", (
356+
"Expected 'Content-Type' default header not to be overwritten"
357+
)
358+
assert requests_mock.last_request.headers["Content-type"] == "application/json", (
359+
"Create namespace request did not include expected 'Content-Type' header"
360+
)
361361

362-
assert (
363-
catalog._session.headers.get("Customized-Header") == "some/value"
364-
), "Expected 'Customized-Header' header to be 'some/value'"
365-
assert (
366-
requests_mock.last_request.headers["Customized-Header"] == "some/value"
367-
), "Create namespace request did not include expected 'Customized-Header' header"
362+
assert catalog._session.headers.get("Customized-Header") == "some/value", (
363+
"Expected 'Customized-Header' header to be 'some/value'"
364+
)
365+
assert requests_mock.last_request.headers["Customized-Header"] == "some/value", (
366+
"Create namespace request did not include expected 'Customized-Header' header"
367+
)
368368

369369

370370
@pytest.mark.filterwarnings(

0 commit comments

Comments
 (0)