Skip to content

Commit

Permalink
fix: don't reflect nested types for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Mause committed May 19, 2023
1 parent 767e877 commit 3a01f9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 0 additions & 3 deletions duckdb_engine/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ class Map(TypeEngine):
"timestamp_ms": sqltypes.TIMESTAMP,
"timestamp_ns": sqltypes.TIMESTAMP,
"enum": sqltypes.Enum,
"list": lambda: sqltypes.ARRAY(sqltypes.NULLTYPE),
"struct": Struct,
"map": Map,
}


Expand Down
8 changes: 6 additions & 2 deletions duckdb_engine/tests/test_datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ def test_all_types_reflection(engine: Engine) -> None:
conn.execute(text("create table t2 as select * from test_all_types()"))
table = Table("t2", MetaData(), autoload_with=conn)
for col in table.columns:
if col.name.endswith("_enum") and duckdb.__version__ < "0.7.1": # type: ignore[attr-defined]
name = col.name
if name.endswith("_enum") and duckdb.__version__ < "0.7.1": # type: ignore[attr-defined]
continue
assert col.type != sqltypes.NULLTYPE, col.name
if "array" in name or "struct" in name or "map" in name:
assert col.type == sqltypes.NULLTYPE, name
else:
assert col.type != sqltypes.NULLTYPE, name
assert not capture

0 comments on commit 3a01f9d

Please sign in to comment.