This is an automated email from the ASF dual-hosted git repository.
yuqi4733 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new 07a7c3b8a0 [#8935] fix(python): Fix the wrong url for credential in
python (#8938)
07a7c3b8a0 is described below
commit 07a7c3b8a0eb6930a085cd401f02712b4de25a2b
Author: Mini Yu <[email protected]>
AuthorDate: Wed Oct 29 09:16:52 2025 +0800
[#8935] fix(python): Fix the wrong url for credential in python (#8938)
### What changes were proposed in this pull request?
The name of the metadata object to the full name in the URL for
credential vending.
### Why are the changes needed?
It's a bug.
Fix: #8935
### Does this PR introduce _any_ user-facing change?
N/A.
### How was this patch tested?
UT
---
.../gravitino/client/metadata_object_credential_operations.py | 4 ++--
clients/client-python/tests/unittests/test_credential_api.py | 11 +++++++++++
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git
a/clients/client-python/gravitino/client/metadata_object_credential_operations.py
b/clients/client-python/gravitino/client/metadata_object_credential_operations.py
index 12295b6223..c855f064ea 100644
---
a/clients/client-python/gravitino/client/metadata_object_credential_operations.py
+++
b/clients/client-python/gravitino/client/metadata_object_credential_operations.py
@@ -48,10 +48,10 @@ class
MetadataObjectCredentialOperations(SupportsCredentials):
):
self._rest_client = rest_client
metadata_object_type = metadata_object.type().value
- metadata_object_name = metadata_object.name()
+ metadata_object_fullname = metadata_object.full_name()
self._request_path = (
f"api/metalakes/{encode_string(metalake_name)}/objects/{metadata_object_type}/"
- f"{encode_string(metadata_object_name)}/credentials"
+ f"{encode_string(metadata_object_fullname)}/credentials"
)
def get_credentials(self) -> List[Credential]:
diff --git a/clients/client-python/tests/unittests/test_credential_api.py
b/clients/client-python/tests/unittests/test_credential_api.py
index bf96b1a25e..3f0f96ba52 100644
--- a/clients/client-python/tests/unittests/test_credential_api.py
+++ b/clients/client-python/tests/unittests/test_credential_api.py
@@ -59,6 +59,17 @@ class TestCredentialApi(unittest.TestCase):
HTTPClient("http://localhost:8090"),
Namespace.of(metalake_name, catalog_name, "schema"),
)
+
+ # check the request path is ok
+ # pylint: disable=protected-access
+ request_path = fileset._object_credential_operations._request_path
+ expected_path = (
+ f"api/metalakes/{metalake_name}/objects/fileset/"
+ f"fileset_catalog.schema.fileset/credentials"
+ )
+
+ self.assertEqual(expected_path, request_path)
+
with patch(
"gravitino.utils.http_client.HTTPClient.get",
return_value=mock_resp,