Skip to content

Commit beb2b80

Browse files
author
Matthew Corley
committed
test(python/adbc_driver_postgresql): make GetObjects test tolerant of extra catalogs
PostgreSQL exposes template catalogs (template0/template1) so GetObjects may return multiple catalog rows even when schema/table filters are used. Update the regression test to select the current catalog entry.
1 parent aea0b1b commit beb2b80

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

python/adbc_driver_postgresql/tests/test_dbapi.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import pyarrow
2525
import pyarrow.dataset
2626
import pytest
27-
2827
from adbc_driver_postgresql import ConnectionOptions, StatementOptions, dbapi
2928

3029

@@ -80,8 +79,12 @@ def test_get_objects_schema_filter_outside_search_path(
8079
.read_all()
8180
.to_pylist()
8281
)
83-
assert len(metadata) == 1
84-
schemas = metadata[0]["catalog_db_schemas"]
82+
83+
catalog_name = postgres.adbc_current_catalog
84+
catalog = next((row for row in metadata if row["catalog_name"] == catalog_name), None)
85+
assert catalog is not None
86+
87+
schemas = catalog["catalog_db_schemas"]
8588
assert len(schemas) == 1
8689
assert schemas[0]["db_schema_name"] == schema_name
8790
tables = schemas[0]["db_schema_tables"]

0 commit comments

Comments
 (0)