Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: pre-commit autoupdate #2803

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ repos:
- id: check-readthedocs

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.1
rev: v0.8.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
Expand Down
26 changes: 13 additions & 13 deletions singer_sdk/connectors/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -1470,19 +1470,19 @@
) -> tuple[int, int]:
# return rank, with higher numbers ranking first

_len = int(getattr(sql_type, "length", 0) or 0)

_pytype = t.cast("type", sql_type.python_type)
if issubclass(_pytype, (str, bytes)):
return 900, _len
if issubclass(_pytype, datetime):
return 600, _len
if issubclass(_pytype, float):
return 400, _len
if issubclass(_pytype, int):
return 300, _len

return 0, _len
len_ = int(getattr(sql_type, "length", 0) or 0)

pytype = t.cast("type", sql_type.python_type)
if issubclass(pytype, (str, bytes)):
return 900, len_
if issubclass(pytype, datetime):
return 600, len_

Check warning on line 1479 in singer_sdk/connectors/sql.py

View check run for this annotation

Codecov / codecov/patch

singer_sdk/connectors/sql.py#L1479

Added line #L1479 was not covered by tests
if issubclass(pytype, float):
return 400, len_

Check warning on line 1481 in singer_sdk/connectors/sql.py

View check run for this annotation

Codecov / codecov/patch

singer_sdk/connectors/sql.py#L1481

Added line #L1481 was not covered by tests
if issubclass(pytype, int):
return 300, len_

return 0, len_

return sorted(sql_types, key=_get_type_sort_key, reverse=True)

Expand Down
2 changes: 1 addition & 1 deletion singer_sdk/sinks/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def _add_sdc_metadata_to_record(
or datetime.datetime.now(tz=datetime.timezone.utc)
).isoformat()
record["_sdc_deleted_at"] = record.get("_sdc_deleted_at")
record["_sdc_sequence"] = int(round(time.time() * 1000))
record["_sdc_sequence"] = round(time.time() * 1000)
record["_sdc_table_version"] = message.get("version")
record["_sdc_sync_started_at"] = self.sync_started_at

Expand Down
6 changes: 3 additions & 3 deletions tests/samples/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def csv_config(outdir: str) -> dict:


@pytest.fixture
def _sqlite_sample_db(sqlite_connector):
def sqlite_sample_db(sqlite_connector: SQLiteConnector):
"""Return a path to a newly constructed sample DB."""
with sqlite_connector._connect() as conn, conn.begin():
for t in range(3):
Expand Down Expand Up @@ -72,12 +72,12 @@ def sqlite_sample_db_catalog(sqlite_sample_db_config) -> Catalog:

@pytest.fixture
def sqlite_sample_tap(
_sqlite_sample_db,
sqlite_sample_db,
sqlite_sample_db_config,
sqlite_sample_db_state,
sqlite_sample_db_catalog,
) -> SQLiteTap:
_ = _sqlite_sample_db
_ = sqlite_sample_db
return SQLiteTap(
config=sqlite_sample_db_config,
catalog=sqlite_sample_db_catalog.to_dict(),
Expand Down
Loading