You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "xiaozcy (via GitHub)" <gi...@apache.org> on 2025/08/25 07:22:27 UTC
[PR] [#7437] feat(client): Java/Python clients and CLI support model version with multiple URIs [gravitino]
xiaozcy opened a new pull request, #8267:
URL: https://github.com/apache/gravitino/pull/8267
### What changes were proposed in this pull request?
Java/Python clients and CLI support model version with multiple URIs.
### Why are the changes needed?
Fix: #(7437)
### Does this PR introduce _any_ user-facing change?
Yes.
### How was this patch tested?
UT & IT.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7437] feat(client): Java/Python clients and CLI support model version with multiple URIs [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #8267:
URL: https://github.com/apache/gravitino/pull/8267#discussion_r2300703219
##########
clients/client-java/src/main/java/org/apache/gravitino/client/GenericModelCatalog.java:
##########
@@ -240,6 +242,54 @@ public void linkModelVersion(
resp.validate();
}
+ @Override
+ public String getModelVersionUri(NameIdentifier ident, int version, String uriName)
+ throws NoSuchModelVersionException, NoSuchModelVersionURINameException {
+ checkModelNameIdentifier(ident);
+ Preconditions.checkArgument(version >= 0, "Model version must be non-negative");
+
+ NameIdentifier modelFullIdent = modelFullNameIdentifier(ident);
+ Map<String, String> queryParam =
+ uriName == null
+ ? Collections.emptyMap()
+ : ImmutableMap.of("uriName", RESTUtils.encodeString(uriName));
Review Comment:
You don't have to encode the query parameter, the Apache Http client will help you to do so:
<img width="752" height="303" alt="image" src="https://github.com/user-attachments/assets/1218d9fd-17d6-4294-8958-8c97cc6fd292" />
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7437] feat(client): Java/Python clients and CLI support model version with multiple URIs [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #8267:
URL: https://github.com/apache/gravitino/pull/8267#discussion_r2300704352
##########
clients/client-java/src/main/java/org/apache/gravitino/client/GenericModelCatalog.java:
##########
@@ -240,6 +242,54 @@ public void linkModelVersion(
resp.validate();
}
+ @Override
+ public String getModelVersionUri(NameIdentifier ident, int version, String uriName)
+ throws NoSuchModelVersionException, NoSuchModelVersionURINameException {
+ checkModelNameIdentifier(ident);
+ Preconditions.checkArgument(version >= 0, "Model version must be non-negative");
+
+ NameIdentifier modelFullIdent = modelFullNameIdentifier(ident);
+ Map<String, String> queryParam =
+ uriName == null
+ ? Collections.emptyMap()
+ : ImmutableMap.of("uriName", RESTUtils.encodeString(uriName));
+ ModelVersionUriResponse resp =
+ restClient.get(
+ formatModelVersionRequestPath(modelFullIdent) + "/versions/" + version + "/uri",
+ queryParam,
+ ModelVersionUriResponse.class,
+ Collections.emptyMap(),
+ ErrorHandlers.modelErrorHandler());
+ resp.validate();
+ return resp.getUri();
+ }
+
+ @Override
+ public String getModelVersionUri(NameIdentifier ident, String alias, String uriName)
+ throws NoSuchModelVersionException, NoSuchModelVersionURINameException {
+ checkModelNameIdentifier(ident);
+ Preconditions.checkArgument(StringUtils.isNotBlank(alias), "Model alias must be non-empty");
+
+ NameIdentifier modelFullIdent = modelFullNameIdentifier(ident);
+ Map<String, String> queryParam =
+ uriName == null
+ ? Collections.emptyMap()
+ : ImmutableMap.of("uriName", RESTUtils.encodeString(uriName));
Review Comment:
Also here.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7437] feat(client): Java/Python clients and CLI support model version with multiple URIs [gravitino]
Posted by "xiaozcy (via GitHub)" <gi...@apache.org>.
xiaozcy commented on PR #8267:
URL: https://github.com/apache/gravitino/pull/8267#issuecomment-3223059468
Hi @jerryshao , this PR is ready for review, thx~
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7437] feat(client): Java/Python clients and CLI support model version with multiple URIs [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #8267:
URL: https://github.com/apache/gravitino/pull/8267#discussion_r2300714005
##########
clients/client-python/pylintrc:
##########
@@ -93,3 +93,7 @@ variable-naming-style=snake_case
# Naming Style for Module
module-naming-style=snake_case
+
+[DESIGN]
+# Maximum number of return statements allowed in a function
+max-returns=10
Review Comment:
You'd better not change this, you can add the comment to the place where the code has an such issue.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7437] feat(client): Java/Python clients and CLI support model version with multiple URIs [gravitino]
Posted by "xiaozcy (via GitHub)" <gi...@apache.org>.
xiaozcy commented on code in PR #8267:
URL: https://github.com/apache/gravitino/pull/8267#discussion_r2302644624
##########
clients/client-python/pylintrc:
##########
@@ -93,3 +93,7 @@ variable-naming-style=snake_case
# Naming Style for Module
module-naming-style=snake_case
+
+[DESIGN]
+# Maximum number of return statements allowed in a function
+max-returns=10
Review Comment:
Done.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7437] feat(client): Java/Python clients and CLI support model version with multiple URIs [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao merged PR #8267:
URL: https://github.com/apache/gravitino/pull/8267
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7437] feat(client): Java/Python clients and CLI support model version with multiple URIs [gravitino]
Posted by "xiaozcy (via GitHub)" <gi...@apache.org>.
xiaozcy commented on code in PR #8267:
URL: https://github.com/apache/gravitino/pull/8267#discussion_r2302644071
##########
clients/client-java/src/main/java/org/apache/gravitino/client/GenericModelCatalog.java:
##########
@@ -240,6 +242,54 @@ public void linkModelVersion(
resp.validate();
}
+ @Override
+ public String getModelVersionUri(NameIdentifier ident, int version, String uriName)
+ throws NoSuchModelVersionException, NoSuchModelVersionURINameException {
+ checkModelNameIdentifier(ident);
+ Preconditions.checkArgument(version >= 0, "Model version must be non-negative");
+
+ NameIdentifier modelFullIdent = modelFullNameIdentifier(ident);
+ Map<String, String> queryParam =
+ uriName == null
+ ? Collections.emptyMap()
+ : ImmutableMap.of("uriName", RESTUtils.encodeString(uriName));
Review Comment:
Fixed.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7437] feat(client): Java/Python clients and CLI support model version with multiple URIs [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #8267:
URL: https://github.com/apache/gravitino/pull/8267#discussion_r2300714005
##########
clients/client-python/pylintrc:
##########
@@ -93,3 +93,7 @@ variable-naming-style=snake_case
# Naming Style for Module
module-naming-style=snake_case
+
+[DESIGN]
+# Maximum number of return statements allowed in a function
+max-returns=10
Review Comment:
You'd better not change this, you can add the comment to the place where the code has such an issue.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org