When a namespace is provided as a parameter, SqlCatalog.list_namespaces(namespace) returns the namespace itself.
>>> import pyiceberg
>>> pyiceberg.__version__
'0.9.0'
>>> from pyiceberg.catalog.sql import SqlCatalog
>>> catalog = SqlCatalog("example", **{"uri":"sqlite:///:memory:", "warehouse":"/tmp/pyiceberg/warehouse"})
>>> catalog.list_namespaces()
[]
>>> catalog.create_namespace("ns1.ns2")
>>> catalog.create_namespace("ns1.ns2.ns3")
>>> catalog.list_namespaces()
[('ns1', 'ns2'), ('ns1', 'ns2', 'ns3')]
>>> catalog.create_namespace("ns1")
>>> catalog.list_namespaces()
[('ns1',), ('ns1', 'ns2'), ('ns1', 'ns2', 'ns3')]
>>> catalog.list_namespaces("ns1")
[('ns1',)]
Similar to other catalog implementations, calling list_namespaces with a namespace as a parameter should return only the sub-namespaces, excluding the namespace itself.
e.g. for other python catalogs
Apache Iceberg version
main (development)
Please describe the bug 🐞
When a namespace is provided as a parameter, SqlCatalog.list_namespaces(namespace) returns the namespace itself.
Expected behavior
Similar to other catalog implementations, calling list_namespaces with a namespace as a parameter should return only the sub-namespaces, excluding the namespace itself.
e.g. for other python catalogs
iceberg-python/tests/catalog/integration_test_glue.py
Line 321 in 7a4734e
iceberg-python/tests/catalog/integration_test_dynamodb.py
Line 213 in 7a4734e
And the for the JdbcCatalog in Java:
Willingness to contribute