You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "alessandro-nori (via GitHub)" <gi...@apache.org> on 2025/02/08 16:23:47 UTC

[I] Incorrect Output from `list_namespaces` in `SqlCatalog` [iceberg-python]

alessandro-nori opened a new issue, #1627:
URL: https://github.com/apache/iceberg-python/issues/1627

   ### 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.
   
   ```
   >>> 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',)]
   ```
   
   ## 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
   
   - GlueCatalog: https://github.com/apache/iceberg-python/blob/7a4734e26ed64d4b37f4a722e3b710e9866073ef/tests/catalog/integration_test_glue.py#L321
   - DynamoDbCatalog: https://github.com/apache/iceberg-python/blob/7a4734e26ed64d4b37f4a722e3b710e9866073ef/tests/catalog/integration_test_dynamodb.py#L213
   
   And the for the JdbcCatalog in Java:
   - Implementation reference: https://github.com/apache/iceberg/blob/746e71931a35e83726852a60d7ca8cb6065e334f/core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java#L459-L460
   - UnitTest: https://github.com/apache/iceberg/blob/41b458b7022c7b0cd78eeca9102392db7889d3c9/core/src/test/java/org/apache/iceberg/jdbc/TestJdbcCatalog.java#L747
   
   
   
   
   ### Willingness to contribute
   
   - [x] I can contribute a fix for this bug independently
   - [ ] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
   - [ ] I cannot contribute a fix for this bug at this time


-- 
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-unsubscribe@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Incorrect Output from `list_namespaces` in `SqlCatalog` [iceberg-python]

Posted by "Fokko (via GitHub)" <gi...@apache.org>.
Fokko closed issue #1627: Incorrect Output from `list_namespaces` in `SqlCatalog`
URL: https://github.com/apache/iceberg-python/issues/1627


-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Incorrect Output from `list_namespaces` in `SqlCatalog` [iceberg-python]

Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on issue #1627:
URL: https://github.com/apache/iceberg-python/issues/1627#issuecomment-2645837366

   assigned this issue to you. feel free to tag me for review.


-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Incorrect Output from `list_namespaces` in `SqlCatalog` [iceberg-python]

Posted by "Fokko (via GitHub)" <gi...@apache.org>.
Fokko closed issue #1627: Incorrect Output from `list_namespaces` in `SqlCatalog`
URL: https://github.com/apache/iceberg-python/issues/1627


-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Incorrect Output from `list_namespaces` in `SqlCatalog` [iceberg-python]

Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on issue #1627:
URL: https://github.com/apache/iceberg-python/issues/1627#issuecomment-2645837770

   This is another reason why I raised #813. It'll be great to modify our existing test suite to test behaviors across all catalogs 


-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Incorrect Output from `list_namespaces` in `SqlCatalog` [iceberg-python]

Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on issue #1627:
URL: https://github.com/apache/iceberg-python/issues/1627#issuecomment-2645837123

   Thanks for raising this issue! Yea, the behavior should align with the java implementation and other catalogs. 
   


-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org