-
Notifications
You must be signed in to change notification settings - Fork 218
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
Fix table_exists
behavior in REST catalog
#1096
Conversation
@@ -701,17 +702,17 @@ def test_load_table_404(rest_mock: Mocker) -> None: | |||
assert "Table does not exist" in str(e.value) | |||
|
|||
|
|||
def test_table_exist_200(rest_mock: Mocker) -> None: | |||
def test_table_exists_200(rest_mock: Mocker) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is interesting, the integration tests aren't working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don’t have integration tests for the catalog interactions, so I created an issue to implement a test suite: #1010
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM, thanks!
table_exists
behavior in REST catalog
I understand that it might seem odd to return false for a 200 status code, but according to the specification, success should only be indicated by a 204 status code. Additionally, it doesn’t make sense to throw an exception for a 404 status code since a table_exists method is expected to return True or False, not just True or an exception.
If a user needs to handle exceptions, they can use the load_table method, which will return an exception if the table does not exist.
Solves: #1018