yuqi1129 commented on code in PR #5757:
URL: https://github.com/apache/gravitino/pull/5757#discussion_r1872942461
##########
clients/client-python/gravitino/dto/requests/catalog_create_request.py:
##########
@@ -60,5 +60,3 @@ def validate(self):
raise ValueError('"name" field is required and cannot be empty')
if not self._type:
raise ValueError('"catalog_type" field is required and cannot be
empty')
- if not self._provider:
Review Comment:
I see.
##########
common/src/main/java/org/apache/gravitino/dto/requests/CatalogCreateRequest.java:
##########
@@ -79,6 +81,17 @@ public CatalogCreateRequest(
this.properties = properties;
}
+ /**
+ * Sets the provider of the catalog.
+ *
+ * @param provider The provider of the catalog.
+ */
+ @JsonSetter(value = "provider")
+ public void setProvider(String provider) {
+ this.provider =
+ StringUtils.isNotBlank(provider) ? provider :
CatalogProvider.builtinShortName(type);
Review Comment:
This makes sense, but it can't cover some cases. For instance, if users set
the type = 'relational' and `provider`= 'null', then the final error will be
very misleading, and users may have a problem finding what's wrong.
<img width="1528" alt="image"
src="https://github.com/user-attachments/assets/8e18e1b6-8a12-471f-9c0f-c4680c82ba64">
--
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]