laserninja opened a new pull request, #13794:
URL: https://github.com/apache/gravitino/pull/13794
### What changes were proposed in this pull request?
Expose `SemanticModel.supports_tags()` and wire `GenericSemanticModel` into
the existing `MetadataObjectTagOperations`. Preserve the full namespace and
shared HTTP client on create, load, and alter, using the returned model name
after a rename.
Add unit tests and a separate `test_semantic_model_tags_and_owner.py`
integration module covering tag association, values, listing, retrieval,
removal, renamed identity, errors, permission grants/revocation, inherited
deny, and user/group ownership assignment and retrieval through the existing
generic `get_owner()` and `set_owner()` APIs.
### Why are the changes needed?
Models returned by the Python SDK currently raise `AttributeError` on
`supports_tags()`, even though the server already exposes generic tag and owner
operations.
Part of #12209. **Draft: blocked on #13793 and the separate server
authorization prerequisite.** This branch is stacked on the mapping commit from
#13793, so its changes are currently included in the comparison against `main`.
The focused tag/owner commit is `d023ba8d9cf675926657e6281bf1836a8940b00a`.
Rebase onto `main` after the prerequisites merge, leaving only the five Python
SDK/test files in this PR. The new authorization tests also require the
separately prepared server correction that groups the `CAN_ACCESS_METADATA`
expansion so tag reads enforce tag privileges. That server change is excluded
from this Python PR.
#12860 is already merged. This change does not stack on the closed, unmerged
#13768. Ossie import/export is out of scope.
### Does this PR introduce _any_ user-facing change?
Yes. Semantic Models returned by the Python SDK expose the same tag
operations as other supported metadata objects. The existing generic ownership
API is tested with Semantic Models. No separate ownership API is added.
### How was this patch tested?
- Reproduced the original missing `supports_tags()` failure through the
public Python SDK against a live current-main server before changing production
code.
- Python 3.11 unit suite: **1,225 passed**, including seven new unit tests.
- Unmodified current-main server (`b837e07a9`): **six of seven new
integration tests passed**. The preserved tag authorization test fails because
the existing server permits a tag read without tag permission.
- Current-main server with the separate authorization prerequisite: **18
integration tests passed**: seven new tag/owner tests, four Semantic Model
authorization tests from #13793, and seven existing role-management tests.
Authorization was enabled, using a local Iceberg memory catalog.
- Changed-file Pylint: **10.00/10**. Black, `git diff --check`, and
`./gradlew spotlessApply -PskipWeb`: passed.
- Independent standards and contract reviews: no findings.
Commands run from the repository root:
```sh
PYTHONPATH=clients/client-python python -m unittest discover -s
clients/client-python/tests/unittests
GRAVITINO_HOME=<local-server> START_EXTERNAL_GRAVITINO=true
PYTHONPATH=clients/client-python \
python -m unittest tests.integration.test_semantic_model_tags_and_owner \
tests.integration.test_semantic_model_authorization
tests.integration.test_role_management
```
All newly added integration tests ran. Full repository and Docker/cloud
integration suites, and the Python 3.10/3.12 matrix, were not run.
--
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]