alessandro-nori commented on code in PR #1629: URL: https://github.com/apache/iceberg-python/pull/1629#discussion_r1957833614
########## tests/catalog/test_sql.py: ########## @@ -1117,17 +1117,30 @@ def test_create_namespace_with_empty_identifier(catalog: SqlCatalog, empty_names lazy_fixture("catalog_sqlite"), ], ) -@pytest.mark.parametrize("namespace_list", [lazy_fixture("database_list"), lazy_fixture("hierarchical_namespace_list")]) -def test_list_namespaces(catalog: SqlCatalog, namespace_list: List[str]) -> None: +def test_list_namespaces(catalog: SqlCatalog) -> None: + namespace_list = ["db", "db.ns1", "db.ns1.ns2", "db.ns2", "db2", "db2.ns1", "db%"] for namespace in namespace_list: catalog.create_namespace(namespace) - # Test global list + ns_list = catalog.list_namespaces() - for namespace in namespace_list: - assert Catalog.identifier_to_tuple(namespace) in ns_list - # Test individual namespace list - assert len(one_namespace := catalog.list_namespaces(namespace)) == 1 - assert Catalog.identifier_to_tuple(namespace) == one_namespace[0] + expected_list: list[tuple[str, ...]] = [("db",), ("db2",), ("db%",)] + for ns in expected_list: + assert ns in ns_list Review Comment: the first assertion doesn't work if you run all the tests in `test_sql.py` because there are other top-level namespaces created by other tests -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org