-
Notifications
You must be signed in to change notification settings - Fork 197
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
Feat: Implement create_table_if_not_exists
#415
Conversation
3616462
to
ef96baf
Compare
ef96baf
to
29e6374
Compare
I think we should have some more discussion around this. I would prefer to have, analog to SQL, a |
This feels analogous to the SQL |
Exactly, this implements If you prefer to have a new method |
@hussein-awala Thanks! You're right, and I think |
I will update the PR then 👍 |
create_table_if_not_exists
I think it's ready 🤞 |
@@ -560,6 +560,64 @@ def test_create_table_409(rest_mock: Mocker, table_schema_simple: Schema) -> Non | |||
assert "Table already exists" in str(e.value) | |||
|
|||
|
|||
def test_create_table_if_not_exists_200( |
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.
Nice! It would have been easier to write an integration test, but great job on the mocking 👍
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.
@hussein-awala This looks great, thanks!
* Feat: Add fail_if_exists param to create_table * create create_table_if_not_exists method * fix reset test * fix mypy check
closes: #406
This PR implements the
create_table_if_not_exists
method to create the table if it doesn't exist, and return the existing table if it exists instead of raising aTableAlreadyExistsError
exception.