gedaliakliger opened a new pull request, #4503:
URL: https://github.com/apache/iceberg-python/pull/4503

   # Rationale for this change
   
   `SqlCatalog.create_namespace` writes the reserved `exists` property only 
when no user properties are supplied. Removing every property from such a 
namespace deleted its only row from `iceberg_namespace_properties`, so 
`namespace_exists` returned false and the namespace vanished from 
`list_namespaces`. Java's `JdbcCatalog.createNamespace` always stores 
`exists=true` alongside user properties, and `JdbcUtil.namespaceExists` relies 
on those rows. When removals leave no properties, store the minimal `exists` 
row again.
   
   ## Are these changes tested?
   
   `test_update_namespace_properties_removes_all_properties` in 
`tests/catalog/test_catalog_behaviors.py` removes the only property and asserts 
the namespace still exists, is listed, and loads with `{"exists": "true"}`. It 
fails on `main` (9 cases, `assert False` on `namespace_exists`) and passes with 
this change (9 cases).
   
   Ran here: `.venv/bin/python -m pytest 
tests/catalog/test_catalog_behaviors.py -m unit -k 
update_namespace_properties_removes_all_properties -v`, `.venv/bin/prek run 
ruff ruff-format --files pyiceberg/catalog/sql.py 
tests/catalog/test_catalog_behaviors.py`, `.venv/bin/prek run mypy --files 
pyiceberg/catalog/sql.py tests/catalog/test_catalog_behaviors.py`. CI runs the 
full suite.
   
   ## Are there any user-facing changes?
   
   Yes. Removing all properties from a SQL catalog namespace no longer makes 
the namespace disappear; it stays listed and reports `{"exists": "true"}`.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to