[#12116] improvement(client-python): Add view create/drop operations#12117
Merged
Conversation
Code Coverage Report
|
Contributor
Author
|
@jerryshao @mchades Could you help review this? Thanks! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds view create/drop support to the Gravitino Python client’s relational catalog, introducing view-specific DTOs and REST error handling and expanding tests to cover the new functionality.
Changes:
- Extend
RelationalCatalogto implementViewCatalogand addas_view_catalog(),create_view(), anddrop_view(). - Add view REST DTOs (
ViewCreateRequest,ViewResponse) and a view-specific REST error handler. - Add unit and integration tests for view create/drop behavior and error handling.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| clients/client-python/gravitino/client/relational_catalog.py | Implements ViewCatalog on RelationalCatalog and adds view create/drop REST calls plus shared namespace/path helpers. |
| clients/client-python/gravitino/dto/requests/view_create_request.py | Adds DTO for view creation requests, including validation and representation (de)serialization. |
| clients/client-python/gravitino/dto/responses/view_response.py | Adds DTO for view operation responses with validation. |
| clients/client-python/gravitino/exceptions/handlers/view_error_handler.py | Adds view-specific REST error handling and exception mapping. |
| clients/client-python/tests/unittests/test_relational_catalog.py | Adds unit tests for as_view_catalog, create_view, and drop_view. |
| clients/client-python/tests/unittests/test_error_handler.py | Adds unit tests for the new VIEW_ERROR_HANDLER. |
| clients/client-python/tests/unittests/dto/requests/test_view_create_request.py | Adds unit tests for ViewCreateRequest validation and JSON serialization. |
| clients/client-python/tests/unittests/dto/responses/test_view_response.py | Adds unit tests for ViewResponse validation and round-trip serialization. |
| clients/client-python/tests/integration/test_relational_catalog.py | Adds integration tests for view creation, duplicate creation, deletion, and deletion of nonexistent views. |
jerryshao
reviewed
Jul 21, 2026
Contributor
|
Overall LGTM, just some minor issues. |
Contributor
Author
Thanks! Just updated. |
jerryshao
approved these changes
Jul 22, 2026
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.
What changes were proposed in this pull request?
RelationalCatalogwithViewCatalog.as_view_catalog,create_view, anddrop_view.Why are the changes needed?
The Python client currently lacks support for view create/drop operations. These changes allow users to create and drop views through the Python client.
Fix: #12116
Does this PR introduce any user-facing change?
Yes. Python client users can now create and drop views through
RelationalCatalog.as_view_catalog().How was this patch tested?
Added unit tests for request and response validation, REST error handling, and view create/drop operations.
Added integration tests covering view creation, duplicate creation, view deletion, and deletion of nonexistent views.