Skip to content

Commit

Permalink
chore: pre-commit autoupdate (#2828)
Browse files Browse the repository at this point in the history
* chore: pre-commit autoupdate

updates:
- [github.com/python-jsonschema/check-jsonschema: 0.30.0 → 0.31.0](python-jsonschema/check-jsonschema@0.30.0...0.31.0)
- [github.com/astral-sh/ruff-pre-commit: v0.8.6 → v0.9.1](astral-sh/ruff-pre-commit@v0.8.6...v0.9.1)
- [github.com/python-poetry/poetry: 2.0.0 → 2.0.1](python-poetry/poetry@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>
  • Loading branch information
pre-commit-ci[bot] authored Jan 13, 2025
1 parent a8e6bf0 commit 8638b07
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 35 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -59,6 +59,6 @@ repos:
)$
- repo: https://github.com/python-poetry/poetry
rev: 2.0.0
rev: 2.0.1
hooks:
- id: poetry-check
3 changes: 1 addition & 2 deletions singer_sdk/_singerlib/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
12 changes: 6 additions & 6 deletions singer_sdk/testing/tap_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions singer_sdk/testing/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions tests/core/test_catalog_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)
12 changes: 6 additions & 6 deletions tests/core/test_jsonschema_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
6 changes: 3 additions & 3 deletions tests/core/test_state_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 6 additions & 6 deletions tests/external/test_tap_gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions tests/samples/test_target_sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 8638b07

Please sign in to comment.