diff --git a/docs/source/python/recipe/postgresql_get_table_schema.py b/docs/source/python/recipe/postgresql_get_table_schema.py index d0d9c4e063..59034c0c11 100644 --- a/docs/source/python/recipe/postgresql_get_table_schema.py +++ b/docs/source/python/recipe/postgresql_get_table_schema.py @@ -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() @@ -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()