gedaliakliger opened a new pull request, #4469:
URL: https://github.com/apache/iceberg-python/pull/4469
# Rationale for this change
`SqlCatalog.drop_namespace` only checks for tables. With namespaces `a` and
`a.b`, `drop_namespace("a")` deletes the properties of `a` and returns, while
`a` is still listed and still exists through its child. `InMemoryCatalog`
inherits this.
Java's `JdbcCatalog.dropNamespace` throws `NamespaceNotEmptyException` when
`listNamespaces(namespace)` is not empty. This change does the same and raises
`NamespaceNotEmptyError`.
## Are these changes tested?
Yes. `test_drop_namespace_raises_error_when_namespace_has_child_namespaces`
fails on `main` (`DID NOT RAISE NamespaceNotEmptyError`) and passes with this
change. Ran here: the namespace tests in
`tests/catalog/test_catalog_behaviors.py`, `tests/catalog/test_sql.py` and
`tests/cli/test_console.py` (258 passed), plus ruff, ruff-format and mypy on
the changed files. The full suites are left to CI.
## Are there any user-facing changes?
Yes. `drop_namespace` on `SqlCatalog` and `InMemoryCatalog` raises
`NamespaceNotEmptyError` for a namespace that has child namespaces, instead of
returning without dropping it.
--
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]