sunyuhan1998 opened a new pull request, #10809: URL: https://github.com/apache/gravitino/pull/10809
### What changes were proposed in this pull request? Add `get_owner` / `set_owner` API to the Python SDK, aligning with the Java client's `GravitinoMetalake.getOwner()` / `setOwner()` methods. **New files:** - `gravitino/api/authorization/owner.py` — Owner interface with `Type` enum (`USER` / `GROUP`) - `gravitino/dto/authorization/owner_dto.py` — OwnerDTO - `gravitino/dto/requests/owner_set_request.py` — setOwner request body - `gravitino/dto/responses/owner_response.py` — getOwner response - `gravitino/dto/responses/set_response.py` — setOwner response - `gravitino/exceptions/handlers/owner_error_handler.py` — Owner error handler **Modified files:** - `gravitino/client/gravitino_metalake.py` — Add `get_owner` / `set_owner` methods - `gravitino/client/gravitino_client.py` — Add delegation methods ### Why are the changes needed? The Java SDK already supports ownership management, but the Python SDK lacks these APIs. Users must fall back to raw REST calls via `requests`, which is inconsistent with the SDK design. Fix: #10808 ### Does this PR introduce _any_ user-facing change? Yes, two new public APIs are added: - `GravitinoClient.get_owner(metadata_object)` → `Optional[Owner]` - `GravitinoClient.set_owner(metadata_object, owner_name, owner_type)` → `None` No existing APIs are changed. ### How was this patch tested? Unit tests added in `tests/unittests/test_owner.py` (17 test cases): - Integration tests: `get_owner` (user/group/none), `set_owner` (success/false) - Error handler tests: all 5 error code branches (`ILLEGAL_ARGUMENTS`, `NOT_FOUND`, `UNSUPPORTED_OPERATION`, `NOT_IN_USE`, `INTERNAL_ERROR`) - Validation tests: `OwnerSetRequest.validate()` (empty name, none type), `OwnerResponse.validate()` (empty name, none type, no owner) -- 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]
