Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 9, 2024
1 parent 5196b73 commit 037e794
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
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_

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
4 changes: 2 additions & 2 deletions tests/samples/conftest.py
Original file line number Diff line number Diff line change
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 037e794

Please sign in to comment.