Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lidavidm committed Oct 29, 2024
1 parent 4db29f7 commit 78b3622
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions docs/source/python/recipe/postgresql_get_table_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

cur.execute("CREATE SCHEMA IF NOT EXISTS other_schema")
cur.execute("DROP TABLE IF EXISTS other_schema.example")
cur.execute("CREATE TABLE other_schema.example (strings TEXT, values NUMERIC)")
cur.execute("CREATE TABLE other_schema.example (strings TEXT, values INT)")

conn.commit()

Expand All @@ -56,16 +56,14 @@
#:
#: Note that the NUMERIC column is read as a string, because PostgreSQL
#: decimals do not map onto Arrow decimals.
table_schema = conn.adbc_get_table_schema(
assert conn.adbc_get_table_schema(
"example",
db_schema_filter="other_schema",
)
expected = pyarrow.schema(
) == pyarrow.schema(
[
("strings", "string"),
("values", "string"),
("values", "int32"),
]
)
assert table_schema == expected, f"Unexpected table schema {table_schema}"

conn.close()

0 comments on commit 78b3622

Please sign in to comment.