Skip to content

REST: Raise NoSuchNamespaceError for 404 on create_view and register - #4466

Open
1yangsh wants to merge 1 commit into
apache:mainfrom
1yangsh:rest-create-register-missing-namespace
Open

1yangsh wants to merge 1 commit into
apache:mainfrom
1yangsh:rest-create-register-missing-namespace

Conversation

@1yangsh

@1yangsh 1yangsh commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

The REST OpenAPI spec defines a 404 from createView, registerTable and registerView as "Not Found - The namespace specified does not exist". create_table already maps that to NoSuchNamespaceError. However, create_view, register_table and register_view only mapped 409, so a missing namespace surfaced as a generic RESTError.

Are these changes tested?

Yes. Added test_create_view_404, test_register_table_404 and test_register_view_404 in tests/catalog/test_rest.py.

Are there any user-facing changes?

Yes. These methods now raise NoSuchNamespaceError instead of RESTError when the namespace does not exist.

AI disclosure: an AI coding assistant helped draft the change and the tests. The mapping was checked against the REST OpenAPI spec, and the catalog tests and linters were run before submitting.

The REST spec defines a 404 from createView, registerTable and
registerView as "the namespace specified does not exist", and create_table
already maps it to NoSuchNamespaceError. These three methods had no 404
mapping, so a missing namespace surfaced as a generic RESTError.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant