Skip to content

Commit

Permalink
fix some tests for sqlalchemy 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Sep 5, 2024
1 parent 3427cc8 commit 7264799
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/load/sources/sql_database/test_sql_database_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def test_type_adapter_callback(
def conversion_callback(t):
if isinstance(t, sa.JSON):
return sa.Text
elif isinstance(t, sa.Double): # type: ignore[attr-defined]
elif hasattr(sa, "Double") and isinstance(t, sa.Double): # type: ignore[attr-defined]
return sa.BIGINT
return t

Expand Down Expand Up @@ -436,7 +436,11 @@ def conversion_callback(t):
schema = pipeline.default_schema
table = schema.tables["has_precision"]
assert table["columns"]["json_col"]["data_type"] == "text"
assert table["columns"]["float_col"]["data_type"] == "bigint"
assert (
table["columns"]["float_col"]["data_type"] == "bigint"
if hasattr(sa, "Double")
else "double"
)


@pytest.mark.parametrize("backend", ["sqlalchemy", "pyarrow", "pandas", "connectorx"])
Expand Down

0 comments on commit 7264799

Please sign in to comment.