[#12441] feat(client-python): Support tag assignment values - #12442
Open
roryqi wants to merge 2 commits into
Open
[#12441] feat(client-python): Support tag assignment values#12442roryqi wants to merge 2 commits into
roryqi wants to merge 2 commits into
Conversation
roryqi
force-pushed
the
tag-assignment-values-python-client
branch
3 times, most recently
from
August 12, 2026 13:48
db2144d to
2b79236
Compare
roryqi
force-pushed
the
tag-assignment-values-python-client
branch
from
August 12, 2026 13:50
2b79236 to
c1f4bf0
Compare
Code Coverage Report
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Python client support for tag assignment values across DTOs, tag APIs, metadata objects, and associated-object filtering.
Changes:
- Adds allowed and assignment values to tag models and creation.
- Adds value-pair assignment APIs while retaining legacy association.
- Adds value-filtered lookup and unit coverage.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/unittests/test_tag_api.py |
Tests tag creation with allowed values. |
tests/unittests/test_generic_view.py |
Verifies view assignment support. |
tests/unittests/test_generic_tag.py |
Tests values and filtered lookup. |
tests/unittests/test_generic_function.py |
Verifies function assignment support. |
tests/unittests/mock_base.py |
Extends tag mocks with values. |
tests/unittests/dto/test_tag_dto.py |
Tests tag value serialization and equality. |
tests/unittests/dto/requests/test_tags_associate_request.py |
Tests assignment request DTOs. |
tests/unittests/dto/requests/test_tag_create_request.py |
Tests allowed-value serialization. |
tests/unittests/client/test_metadata_object_tag_operations.py |
Tests legacy and value-based requests. |
gravitino/dto/tag_dto.py |
Adds allowed and assignment values. |
gravitino/dto/requests/tag_create_request.py |
Adds allowed-value request validation. |
gravitino/dto/requests/tag_associate_request.py |
Adds name and value-pair requests. |
gravitino/dto/requests/__init__.py |
Exports new request DTOs. |
gravitino/client/relational_table.py |
Exposes tag assignment. |
gravitino/client/metadata_object_tag_operations.py |
Implements versioned value assignment. |
gravitino/client/gravitino_metalake.py |
Passes allowed values during creation. |
gravitino/client/gravitino_client.py |
Exposes allowed-value creation. |
gravitino/client/generic_view.py |
Exposes tag assignment. |
gravitino/client/generic_tag.py |
Exposes values and filtered lookup. |
gravitino/client/generic_schema.py |
Exposes tag assignment. |
gravitino/client/generic_model.py |
Exposes tag assignment. |
gravitino/client/generic_function.py |
Exposes tag assignment. |
gravitino/client/generic_fileset.py |
Exposes tag assignment. |
gravitino/client/generic_column.py |
Exposes tag assignment. |
gravitino/client/base_schema_catalog.py |
Exposes tag assignment. |
gravitino/api/tag/tag.py |
Extends the public tag API. |
gravitino/api/tag/tag_operations.py |
Adds allowed-value creation parameter. |
gravitino/api/tag/supports_tags.py |
Adds the assignment API contract. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+89
to
+90
| bool(self._tags_to_add) or bool(self._tags_to_remove), | ||
| "tagsToAdd and tagsToRemove cannot both be null or empty", |
Comment on lines
+141
to
+142
| self._validate_pairs(self._tags_to_add, "tagsToAdd") | ||
| self._validate_pairs(self._tags_to_remove, "tagsToRemove") |
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?
This PR adds Python client support for tag assignment values:
allowed_valuessupport to tag creation and tag DTOs.assign_tags(...)while keepingassociate_tags(...)compatible.tag.associated_objects().objects(value=...).Why are the changes needed?
Python client APIs need to match the tag assignment values REST design so users can create tags with allowed values, assign values such as
data_domain=financeto metadata objects, and find objects through the existing tag associated-object lookup API.Fix: #12441
Does this PR introduce any user-facing change?
Yes. The Python client adds:
create_tag(..., allowed_values=None)Tag.allowed_values()Tag.assignment_values()SupportsTags.assign_tags(...)tag.associated_objects().objects(value=None)Existing
associate_tags(...)remains available.How was this patch tested?
PYTHONPATH=/tmp/gravitino-python-tag-values-pr/clients/client-python python -m unittest tests.unittests.test_generic_tag tests.unittests.dto.requests.test_tags_associate_request tests.unittests.dto.requests.test_tag_create_request tests.unittests.dto.test_tag_dto tests.unittests.test_generic_view tests.unittests.test_generic_function tests.unittests.client.test_metadata_object_tag_operations tests.unittests.test_tag_apiPYTHONPATH=/tmp/gravitino-python-tag-values-pr/clients/client-python python -m unittest discover tests/unittestsblack --check ./gravitino ./tests/unittests ./scriptspylint <changed files>Also ran
./gradlew :clients:client-python:test;blackpassed, but the full integration test task failed due to existing environment issues: Python client version2.0.0.dev0was higher than server1.3.1-SNAPSHOT, and Docker imageapache/gravitino-ci:hive-0.1.13was missing.