sunyuhan1998 opened a new pull request, #10760:
URL: https://github.com/apache/gravitino/pull/10760
Add SupportsTags interface implementation to GenericFileset, enabling tag
operations (list, get, associate, remove) on Fileset objects via the Python
client API, matching the Java client's capability.
New files:
- MetadataObjectTagOperations: delegates tag REST calls for metadata objects
- TagsAssociateRequest: request DTO for tag association
Modified files:
- GenericFileset: add SupportsTags inheritance and delegate methods
- test_tag_api.py: add TestObjectTagAPI with 6 unit tests
### What changes were proposed in this pull request?
Implement the `SupportsTags` interface for `GenericFileset`, enabling tag
operations (list, get, associate, remove) on Fileset objects via the Python
client API. This aligns the Python client with the Java client, where
`GenericFileset` already implements `SupportsTags`.
Changes:
- New `MetadataObjectTagOperations` class that delegates tag REST API
calls for metadata objects, following the same pattern as
`MetadataObjectCredentialOperations`
- New `TagsAssociateRequest` DTO for tag association requests
- Modified `GenericFileset` to inherit `SupportsTags` and delegate to
`MetadataObjectTagOperations`
- Added 6 unit tests in `TestObjectTagAPI`
### Why are the changes needed?
The Python client's `GenericFileset` was missing tag support. Users had to
manually construct REST API calls to associate tags with Fileset objects. With
this change, users can now use the idiomatic client API:
```
fileset.associate_tags(["pii", "sensitive"], [])
tags = fileset.list_tags()
tag = fileset.get_tag("pii")
tag_names = fileset.list_tags_info()
```
Fix: #10759
### Does this PR introduce _any_ user-facing change?
Yes. `GenericFileset` now exposes `list_tags()`, `list_tags_info()`,
`get_tag()`, `associate_tags()`, and `supports_tags()` methods. This is a
purely additive change — no existing APIs are modified.
### How was this patch tested?
1. 6 new unit tests in `TestObjectTagAPI` covering all 5 `SupportsTags`
methods + empty name validation
2. All existing unit tests pass (./gradlew :clients:client-python:test
-PskipITs)
3. End-to-end verified against a running Gravitino server with both the
new client API and the previous REST approach — both produce identical results
--
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]