You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "jingjia88 (via GitHub)" <gi...@apache.org> on 2024/08/03 15:45:10 UTC
[PR] [#4227] improvement(client-python): Add Catalog Error Handler and related exceptions, test cases in client-python [gravitino]
jingjia88 opened a new pull request, #4345:
URL: https://github.com/apache/gravitino/pull/4345
### What changes were proposed in this pull request?
Add Catalog Error Handler and related exceptions, test cases in `client-python` based on `client-java`
### Why are the changes needed?
Fix: #4227
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
UT Added and test with `./gradlew client:client-python:test`
--
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] [#4227] improvement(client-python): Add Catalog Error Handler and related exceptions, test cases in client-python [gravitino]
Posted by "noidname01 (via GitHub)" <gi...@apache.org>.
noidname01 commented on code in PR #4345:
URL: https://github.com/apache/gravitino/pull/4345#discussion_r1705438329
##########
clients/client-python/gravitino/exceptions/base.py:
##########
@@ -95,6 +95,18 @@ class UnknownError(RuntimeError):
"""An exception thrown when other unknown exception is thrown"""
+class ConnectionFailedException(GravitinoRuntimeException):
+ """An exception thrown when connect to catalog failed."""
+
+
+class NoSuchCatalogException(NotFoundException):
Review Comment:
This class is redefined.
##########
clients/client-python/tests/unittests/test_error_handler.py:
##########
@@ -151,6 +155,46 @@ def test_metalake_error_handler(self):
ErrorResponse.generate_error_response(Exception, "mock error")
)
+
+ def test_catalog_error_handler(self):
+
+ with self.assertRaises(ConnectionFailedException):
+ CATALOG_ERROR_HANDLER.handle(
+ ErrorResponse.generate_error_response(
+ ConnectionFailedException, "mock error"
+ )
+ )
+
+ with self.assertRaises(NoSuchMetalakeException):
+ CATALOG_ERROR_HANDLER.handle(
+ ErrorResponse.generate_error_response(
+ NoSuchMetalakeException, "mock error"
+ )
+ )
+
+ with self.assertRaises(NoSuchCatalogException):
+ CATALOG_ERROR_HANDLER.handle(
+ ErrorResponse.generate_error_response(
+ NoSuchCatalogException, "mock error"
+ )
+ )
+
+ with self.assertRaises(CatalogAlreadyExistsException):
+ CATALOG_ERROR_HANDLER.handle(
+ ErrorResponse.generate_error_response(
+ CatalogAlreadyExistsException, "mock error"
Review Comment:
There are two right parenthesis missing.
--
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] [#4227] improvement(client-python): Add Catalog Error Handler and related exceptions, test cases in client-python [gravitino]
Posted by "xunliu (via GitHub)" <gi...@apache.org>.
xunliu commented on PR #4345:
URL: https://github.com/apache/gravitino/pull/4345#issuecomment-2268756093
hi @noidname01 Please help review this PR, thanks!
--
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] [#4227] improvement(client-python): Add Catalog Error Handler and related exceptions, test cases in client-python [gravitino]
Posted by "noidname01 (via GitHub)" <gi...@apache.org>.
noidname01 commented on code in PR #4345:
URL: https://github.com/apache/gravitino/pull/4345#discussion_r1706420386
##########
clients/client-python/gravitino/exceptions/base.py:
##########
@@ -95,10 +95,17 @@ class UnknownError(RuntimeError):
"""An exception thrown when other unknown exception is thrown"""
+class ConnectionFailedException(GravitinoRuntimeException):
+ """An exception thrown when connect to catalog failed."""
+
+
+class CatalogAlreadyExistsException(AlreadyExistsException):
Review Comment:
Just like the previous PR, I think it's better to group it with same type of exceptions.
--
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] [#4227] improvement(client-python): Add Catalog Error Handler and related exceptions, test cases in client-python [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades merged PR #4345:
URL: https://github.com/apache/gravitino/pull/4345
--
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] [#4227] improvement(client-python): Add Catalog Error Handler and related exceptions, test cases in client-python [gravitino]
Posted by "jingjia88 (via GitHub)" <gi...@apache.org>.
jingjia88 commented on PR #4345:
URL: https://github.com/apache/gravitino/pull/4345#issuecomment-2271316007
Finished~
--
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] [#4227] improvement(client-python): Add Catalog Error Handler and related exceptions, test cases in client-python [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on PR #4345:
URL: https://github.com/apache/gravitino/pull/4345#issuecomment-2270251862
@jingjia88 would you please fix the conflicts?
--
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] [#4227] improvement(client-python): Add Catalog Error Handler and related exceptions, test cases in client-python [gravitino]
Posted by "jingjia88 (via GitHub)" <gi...@apache.org>.
jingjia88 commented on code in PR #4345:
URL: https://github.com/apache/gravitino/pull/4345#discussion_r1706987806
##########
clients/client-python/gravitino/exceptions/base.py:
##########
@@ -95,10 +95,17 @@ class UnknownError(RuntimeError):
"""An exception thrown when other unknown exception is thrown"""
+class ConnectionFailedException(GravitinoRuntimeException):
+ """An exception thrown when connect to catalog failed."""
+
+
+class CatalogAlreadyExistsException(AlreadyExistsException):
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