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 postgres catalog initialization when tables do not exist #356

Merged
merged 2 commits into from
Feb 4, 2024

Conversation

rahij
Copy link
Contributor

@rahij rahij commented Feb 3, 2024

When sqlalchemy encounters an error if the table does not exist, it raises a different exception from sqlite. Hence, when using postgres, it is not possible to even create the catalog, as the exception is not handled (and therefore, we will not be able to do catalog.create_tables() either). I am able to reproduce this in tests with a postgres docker container, so I can incorporate that into these tests as another parameterized fixture if that is desired.

@rahij
Copy link
Contributor Author

rahij commented Feb 3, 2024

@Fokko would you be the right person to review this?

@Fokko
Copy link
Contributor

Fokko commented Feb 4, 2024

@rahij Sure thing! Can you run make lint to fix the style issues? Thanks!

pyiceberg/catalog/sql.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this @rahij

@Fokko Fokko merged commit a3d529b into apache:main Feb 4, 2024
6 checks passed
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.

2 participants