Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#4226] Improvement(python-client): Add Metalake Error Handler and related exceptions, test cases in client-python #4271

Merged
merged 12 commits into from
Jul 30, 2024

Conversation

jingjia88
Copy link
Contributor

What changes were proposed in this pull request?

  • Add Metalake Error Handler and related exceptions, UT and IT in client-python based on client-java
  • Align exception naming with client-java

Why are the changes needed?

Fix: #4226

Does this PR introduce any user-facing change?

No.

How was this patch tested?

UT and IT added.

@noidname01
Copy link
Collaborator

Hi @jingjia88, thanks for your contribution. There seems to be some conflicts between this PR and main branch.
Please solve them first.

@jingjia88
Copy link
Contributor Author

@noidname01 Thanks for reminding. Done!

@jingjia88 jingjia88 changed the title [#4226] feat(python-client): Add Metalake Error Handler and related exceptions, test cases in client-python [#4226] Improvement(python-client): Add Metalake Error Handler and related exceptions, test cases in client-python Jul 26, 2024
Copy link
Collaborator

@noidname01 noidname01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jingjia88 It seems that you don't use this error handler in methods in gravitino_metalake.py and related files.
And please run the tests locally and make sure the tests you write would pass in your local environment.

@jingjia88
Copy link
Contributor Author

@noidname01 Hi, I have made the changes and run the tests. Could you please review the changes again? Thank you!

Copy link
Collaborator

@noidname01 noidname01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use CatalogErrorHandler in gravitino_metalake.py, not MetalakeErrorHandler.

@jingjia88
Copy link
Contributor Author

@noidname01 Oops, I agree we should use CatalogErrorHandler in gravitino_metalake.py. Since CatalogErrorHandler hasn't been added yet, it might be better to be put into gravitino_metalake.py when solving issue #4227. What do you think?
BTW, I have already removed the errors from MetalakeErrorHandler in gravitino_metalake.py.

Copy link
Collaborator

@noidname01 noidname01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jingjia88 It seems that your code haven't pass black formatter before commit, please format your code.

@@ -54,6 +54,9 @@ class InternalError(GravitinoRuntimeException):
class NotFoundException(GravitinoRuntimeException):
"""Base class for all exceptions thrown when a resource is not found."""

def __init__(self, message, *args):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the __init__ function here is not necessary, because the parent class (GravitinoRuntimeException here) has implemented, except we want some custom features for this class only.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed!

@jingjia88
Copy link
Contributor Author

@noidname01 Done! Please help to take a look again, Thank you~

@noidname01
Copy link
Collaborator

LGTM.

@jerryshao jerryshao merged commit d2cfbf7 into apache:main Jul 30, 2024
13 checks passed
@jerryshao jerryshao added 0.6.0 Release v0.6.0 and removed 0.6.0 Release v0.6.0 labels Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Subtask] Add Metalake Error Handler and related exceptions, test cases in client-python
3 participants