diff --git a/singer_sdk/connectors/sql.py b/singer_sdk/connectors/sql.py index 3302a249f..00c83b884 100644 --- a/singer_sdk/connectors/sql.py +++ b/singer_sdk/connectors/sql.py @@ -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) diff --git a/tests/samples/conftest.py b/tests/samples/conftest.py index d1bd024d3..719f2e20c 100644 --- a/tests/samples/conftest.py +++ b/tests/samples/conftest.py @@ -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(),