Skip to content

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


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