Skip to content

Commit

Permalink
test: add test for enum reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
Mause committed Nov 16, 2022
1 parent 5e4549e commit e478a46
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions duckdb_engine/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,22 @@ def test_table_reflect(session: Session, engine: Engine) -> None:
insp.reflecttable(user_table, None)


def test_enum_reflection(session: Session, engine: Engine) -> None:
importorskip("duckdb", "0.6.1-dev0")

sql = [
"CREATE TYPE enum_t AS ENUM('a', 'b');",
"CREATE TABLE tmp (enum_col enum_t);",
"INSERT INTO tmp VALUES ('b');",
"INSERT INTO tmp VALUES ('a');",
]
for s in sql:
session.execute(text(s))

tmp = Table("tmp", MetaData())
assert inspect(engine).reflecttable(tmp, include_columns=True)


def test_fetch_df_chunks() -> None:
import duckdb

Expand Down

0 comments on commit e478a46

Please sign in to comment.