Repository navigation
Reject dropping a SqlCatalog namespace that has child namespaces - #4469
Open
gedaliakliger wants to merge 1 commit into
Open
gedaliakliger wants to merge 1 commit into
gedaliakliger wants to merge 1 commit into
Conversation
drop_namespace only checked for tables, so dropping a parent namespace deleted its properties and reported success while its children kept it listed. Java's JdbcCatalog.dropNamespace throws NamespaceNotEmptyException in this case.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
SqlCatalog.drop_namespaceonly checks for tables. With namespacesaanda.b,drop_namespace("a")deletes the properties ofaand returns, whileais still listed and still exists through its child.InMemoryCataloginherits this.Java's
JdbcCatalog.dropNamespacethrowsNamespaceNotEmptyExceptionwhenlistNamespaces(namespace)is not empty. This change does the same and raisesNamespaceNotEmptyError.Are these changes tested?
Yes.
test_drop_namespace_raises_error_when_namespace_has_child_namespacesfails onmain(DID NOT RAISE NamespaceNotEmptyError) and passes with this change. Ran here: the namespace tests intests/catalog/test_catalog_behaviors.py,tests/catalog/test_sql.pyandtests/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_namespaceonSqlCatalogandInMemoryCatalograisesNamespaceNotEmptyErrorfor a namespace that has child namespaces, instead of returning without dropping it.