This is an automated email from the ASF dual-hosted git repository.
yuqi4733 pushed a commit to branch branch-1.0
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/branch-1.0 by this push:
new a95887a790 [#8935] fix(python): Fix the wrong url for credential in
python (#8951)
a95887a790 is described below
commit a95887a7900212a45c4133dbb5c1dd6f41808813
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Oct 31 10:08:03 2025 +0800
[#8935] fix(python): Fix the wrong url for credential in python (#8951)
### 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
Co-authored-by: Mini Yu <[email protected]>
---
.../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,