Skip to content

Commit

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

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.1 → v0.8.2](astral-sh/ruff-pre-commit@v0.8.1...v0.8.2)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix Ruff update

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Edgar Ramírez-Mondragón <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and edgarrmondragon authored Dec 9, 2024
1 parent e2a78e9 commit fd494db
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
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 @@ def _get_type_sort_key(
) -> 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_
if issubclass(pytype, float):
return 400, len_
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

0 comments on commit fd494db

Please sign in to comment.