You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "giucris (via GitHub)" <gi...@apache.org> on 2024/05/27 17:01:05 UTC

[I] SqlCatalog and other catalog works different on load_namespace_properties [iceberg-python]

giucris opened a new issue, #769:
URL: https://github.com/apache/iceberg-python/issues/769

   ### Apache Iceberg version
   
   0.6.0 (latest release)
   
   ### Please describe the bug 🐞
   
   During the development of a new feature I encountered a behaviour in the implementation of the SqlCatalog that currently we are using as test catalog and I think is a bug. 
   
   In the documentation of the abstract method list_namespace_properties there is a reference to an exception being thrown if the namespace does not exist, but the current implementation  of SqlCatalog returns an empty dict when the namespace does not exist instead of raising the exception. 
   
   In this way the catalogs, although part of the same "interface" work and function in two completely different ways.
   
   ## How to reproduce it
   
   ```python
       def test_find_namespace(self):
           #initialize in memory sql catalog
           props = {
               "uri": "sqlite+pysqlite:///:memory:",
               "warehouse": f"file://tmp/test_catalog",
           }
           catalog = SqlCatalog("test_catalog", **props)
   
           #create a namespace
           catalog.create_namespace("existing_namespace")
   
           #retrieve properties for the created namespace
           existing_namespace = catalog.load_namespace_properties("existing_namespace")
   
           #retrieve properties for not existing namespace
           not_existing_namespace = catalog.load_namespace_properties("not_existing_namespace")
   
           self.assertEqual(existing_namespace,{"exists":"true"})
           self.assertEqual(not_existing_namespace,{})
   
   ```
   
   ## Expected behavior
   
   As described in the abstract method documentation, the expected behavior is to raise a NoSucheNameSpaceError exception. 
   the same behavior indeed is also implemented in the GlueCatalog that we use on production code.
   
   
   


-- 
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] SqlCatalog and other catalog works different on load_namespace_properties [iceberg-python]

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

   @kevinjqliu Seems like behavior of SqlCatalog for load_namespace_properties is rectified in current version.
   I got it fixed in PR - https://github.com/apache/iceberg-python/pull/591, which was merged a day after this issue was raised.
   
   I checked above code snippet, it raises `pyiceberg.exceptions.NoSuchNamespaceError: Namespace not_existing_namespace does not exists`
   
   I think we can close this issue and its parent issue #813 as well.


-- 
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] SqlCatalog and other catalog works different on load_namespace_properties [iceberg-python]

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

   Yes, that's correct. I don't see this test in 0.6.0 tag.
   


-- 
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] SqlCatalog and other catalog works different on load_namespace_properties [iceberg-python]

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

   > In the documentation of the abstract method list_namespace_properties there is a reference to an exception being thrown if the namespace does not exist, but the current implementation of SqlCatalog returns an empty dict when the namespace does not exist instead of raising the exception.
   
   @soumya-ghosh I think this test covers the issue reported
   https://github.com/apache/iceberg-python/blob/f05b1aedee8451d981188adf68be5e8b360a9ca1/tests/catalog/test_sql.py#L1204-L1213
   
   Would you agree? 


-- 
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] SqlCatalog and other catalog works different on load_namespace_properties [iceberg-python]

Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu closed issue #769: SqlCatalog and other catalog works different on load_namespace_properties
URL: https://github.com/apache/iceberg-python/issues/769


-- 
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