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

Fix table_exists behavior in REST catalog #1096

Merged
merged 1 commit into from
Aug 24, 2024

Conversation

ndrluis
Copy link
Collaborator

@ndrluis ndrluis commented Aug 23, 2024

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

@ndrluis ndrluis marked this pull request as ready for review August 23, 2024 14:10
@@ -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:
Copy link
Contributor

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?

Copy link
Collaborator Author

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

Copy link
Contributor

Choose a reason for hiding this comment

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

SGTM, thanks!

@Fokko Fokko changed the title Fix table_exists behavior in the rest catalog Fix table_exists behavior in REST catalog Aug 23, 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.

3 participants