From 8638b07ca26a64388321af16d40ec4654d296d7b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 17:09:05 -0600 Subject: [PATCH] chore: pre-commit autoupdate (#2828) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: pre-commit autoupdate updates: - [github.com/python-jsonschema/check-jsonschema: 0.30.0 → 0.31.0](https://github.com/python-jsonschema/check-jsonschema/compare/0.30.0...0.31.0) - [github.com/astral-sh/ruff-pre-commit: v0.8.6 → v0.9.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.6...v0.9.1) - [github.com/python-poetry/poetry: 2.0.0 → 2.0.1](https://github.com/python-poetry/poetry/compare/2.0.0...2.0.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- singer_sdk/_singerlib/catalog.py | 3 +-- singer_sdk/testing/tap_tests.py | 12 ++++++------ singer_sdk/testing/templates.py | 6 +++--- tests/core/test_catalog_selection.py | 6 +++--- tests/core/test_jsonschema_helpers.py | 12 ++++++------ tests/core/test_state_handling.py | 6 +++--- tests/external/test_tap_gitlab.py | 12 ++++++------ tests/samples/test_target_sqlite.py | 6 +++--- 9 files changed, 34 insertions(+), 35 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7e38e46db..db4016c54 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,14 +37,14 @@ repos: - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.30.0 + rev: 0.31.0 hooks: - id: check-dependabot - id: check-github-workflows - id: check-readthedocs - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.6 + rev: v0.9.1 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --show-fixes] @@ -59,6 +59,6 @@ repos: )$ - repo: https://github.com/python-poetry/poetry - rev: 2.0.0 + rev: 2.0.1 hooks: - id: poetry-check diff --git a/singer_sdk/_singerlib/catalog.py b/singer_sdk/_singerlib/catalog.py index c1281e091..0dc7ef8b1 100644 --- a/singer_sdk/_singerlib/catalog.py +++ b/singer_sdk/_singerlib/catalog.py @@ -268,8 +268,7 @@ def _breadcrumb_is_selected(self, breadcrumb: Breadcrumb) -> bool: # noqa: PLR0 return md_entry.selected_by_default logger.debug( - "Selection metadata omitted for '%s'. " - "Using parent value of selected=%s.", + "Selection metadata omitted for '%s'. Using parent value of selected=%s.", breadcrumb, parent_value, ) diff --git a/singer_sdk/testing/tap_tests.py b/singer_sdk/testing/tap_tests.py index b5e936b26..becc8a667 100644 --- a/singer_sdk/testing/tap_tests.py +++ b/singer_sdk/testing/tap_tests.py @@ -199,9 +199,9 @@ def test(self) -> None: f"Length of set of records IDs ({count_unique_records})" f" is not equal to number of records ({count_records})." ) - assert all( - all(k is not None for k in pk) for pk in record_ids - ), "Primary keys contain some key values that are null." + assert all(all(k is not None for k in pk) for pk in record_ids), ( + "Primary keys contain some key values that are null." + ) class AttributeIsDateTimeTest(AttributeTestTemplate): @@ -382,9 +382,9 @@ class AttributeNotNullTest(AttributeTestTemplate): def test(self) -> None: """Run test.""" for r in self.stream_records: - assert ( - r.get(self.attribute_name) is not None - ), f"Detected null values for attribute ('{self.attribute_name}')." + assert r.get(self.attribute_name) is not None, ( + f"Detected null values for attribute ('{self.attribute_name}')." + ) @classmethod def evaluate( diff --git a/singer_sdk/testing/templates.py b/singer_sdk/testing/templates.py index 716caaf0a..b04e13079 100644 --- a/singer_sdk/testing/templates.py +++ b/singer_sdk/testing/templates.py @@ -322,9 +322,9 @@ def run( # type: ignore[override] """ # get input from file if getattr(self, "singer_filepath", None): - assert ( - self.singer_filepath.is_file() - ), f"Singer file {self.singer_filepath} does not exist." + assert self.singer_filepath.is_file(), ( + f"Singer file {self.singer_filepath} does not exist." + ) runner.input_filepath = self.singer_filepath super().run(config, resource, runner) diff --git a/tests/core/test_catalog_selection.py b/tests/core/test_catalog_selection.py index d4b30cecb..02797eef1 100644 --- a/tests/core/test_catalog_selection.py +++ b/tests/core/test_catalog_selection.py @@ -245,6 +245,6 @@ def test_record_property_pop( breadcrumb=(), ) - assert ( - record_pop == record_selected - ), f"Expected record={record_selected}, got {record_pop}" + assert record_pop == record_selected, ( + f"Expected record={record_selected}, got {record_pop}" + ) diff --git a/tests/core/test_jsonschema_helpers.py b/tests/core/test_jsonschema_helpers.py index 0e3d9bc49..8729012ab 100644 --- a/tests/core/test_jsonschema_helpers.py +++ b/tests/core/test_jsonschema_helpers.py @@ -606,13 +606,13 @@ def test_property_creation( property_name = next(iter(property_dict.keys())) property_node = property_dict[property_name] if check_fn in type_fn_checks_true: - assert ( - check_fn(property_node) is True - ), f"{check_fn.__name__} was not True for {property_dict!r}" + assert check_fn(property_node) is True, ( + f"{check_fn.__name__} was not True for {property_dict!r}" + ) else: - assert ( - check_fn(property_node) is False - ), f"{check_fn.__name__} was not False for {property_dict!r}" + assert check_fn(property_node) is False, ( + f"{check_fn.__name__} was not False for {property_dict!r}" + ) def test_wrapped_type_dict(): diff --git a/tests/core/test_state_handling.py b/tests/core/test_state_handling.py index 85fd4812f..9fa44c37d 100644 --- a/tests/core/test_state_handling.py +++ b/tests/core/test_state_handling.py @@ -151,9 +151,9 @@ def test_null_replication_value(caplog): check_sorted=check_sorted, ) - assert ( - stream_state["replication_key_value"] == "2021-05-17T20:41:16Z" - ), "State should not be updated." + assert stream_state["replication_key_value"] == "2021-05-17T20:41:16Z", ( + "State should not be updated." + ) assert caplog.records[0].levelname == "WARNING" assert "is null" in caplog.records[0].message diff --git a/tests/external/test_tap_gitlab.py b/tests/external/test_tap_gitlab.py index 19be732ac..543e96e47 100644 --- a/tests/external/test_tap_gitlab.py +++ b/tests/external/test_tap_gitlab.py @@ -49,13 +49,13 @@ def test_gitlab_replication_keys(gitlab_config: dict | None): f"Incorrect 'replication_key' in catalog: ({key_props_2})\n\n" f"Catalog entry was: {catalog_entry}" ) - assert tap.streams[ - stream_name - ].is_timestamp_replication_key, "Failed to detect `is_timestamp_replication_key`" + assert tap.streams[stream_name].is_timestamp_replication_key, ( + "Failed to detect `is_timestamp_replication_key`" + ) - assert tap.streams[ - "commits" - ].is_timestamp_replication_key, "Failed to detect `is_timestamp_replication_key`" + assert tap.streams["commits"].is_timestamp_replication_key, ( + "Failed to detect `is_timestamp_replication_key`" + ) def test_gitlab_sync_epic_issues(gitlab_config: dict | None): diff --git a/tests/samples/test_target_sqlite.py b/tests/samples/test_target_sqlite.py index 9de140a15..48e3a8913 100644 --- a/tests/samples/test_target_sqlite.py +++ b/tests/samples/test_target_sqlite.py @@ -158,9 +158,9 @@ def test_sync_sqlite_to_sqlite( msg = f"Could not parse JSON in new line {line_num}: {new_out}" raise RuntimeError(msg) from e - assert ( - tapped_json["type"] == orig_json["type"] - ), f"Mismatched message type on line {line_num}." + assert tapped_json["type"] == orig_json["type"], ( + f"Mismatched message type on line {line_num}." + ) if tapped_json["type"] == "SCHEMA": assert ( tapped_json["schema"]["properties"].keys()