noidname01 commented on code in PR #4346:
URL: https://github.com/apache/gravitino/pull/4346#discussion_r1717102610


##########
clients/client-python/gravitino/catalog/base_schema_catalog.py:
##########
@@ -238,12 +239,13 @@ def validate(self):
             f"Catalog namespace must be non-null and have 1 level, the input 
namespace is {self._catalog_namespace}",
         )
 
-        assert self.rest_client is not None, "restClient must be set"
-        assert (
-            self.name() is not None and len(self.name().strip()) > 0
-        ), "name must not be blank"
-        assert self.type() is not None, "type must not be None"
-        assert (
-            self.provider() is not None and len(self.provider().strip()) > 0
-        ), "provider must not be blank"
-        assert self.audit_info() is not None, "audit must not be None"
+        if self.rest_client is None:
+            raise IllegalArgumentException("restClient must be set")
+        if not (self.name() and len(self.name().strip()) > 0):

Review Comment:
   I think here can modify into `if not self.name() or not self.name.strip()`



##########
clients/client-python/gravitino/catalog/base_schema_catalog.py:
##########
@@ -238,12 +239,13 @@ def validate(self):
             f"Catalog namespace must be non-null and have 1 level, the input 
namespace is {self._catalog_namespace}",
         )
 
-        assert self.rest_client is not None, "restClient must be set"
-        assert (
-            self.name() is not None and len(self.name().strip()) > 0
-        ), "name must not be blank"
-        assert self.type() is not None, "type must not be None"
-        assert (
-            self.provider() is not None and len(self.provider().strip()) > 0
-        ), "provider must not be blank"
-        assert self.audit_info() is not None, "audit must not be None"
+        if self.rest_client is None:
+            raise IllegalArgumentException("restClient must be set")
+        if not (self.name() and len(self.name().strip()) > 0):
+            raise IllegalArgumentException("name must not be blank")
+        if self.type() is None:
+            raise IllegalArgumentException("type must not be None")
+        if not (self.provider() and len(self.provider().strip()) > 0):

Review Comment:
   Same 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to