-
Notifications
You must be signed in to change notification settings - Fork 116
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
SNOW-911327: Use CTAS for save as table #1075
SNOW-911327: Use CTAS for save as table #1075
Conversation
@pytest.mark.parametrize("table_type", ["", "temp", "temporary", "transient"]) | ||
@pytest.mark.parametrize( | ||
"save_mode", ["append", "overwrite", "ignore", "errorifexists"] | ||
) | ||
def test_save_as_table_respects_schema(session, save_mode, table_type): |
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.
removing excessive table_type
parametrization for tests which don't provide any additional value in the test. I do want to listen to team's opinion on this
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.
To make sure I understand, we only revert the CTAS -> create and insert change, but not the original changes to allow nulls, right?
As for table_type
, as long as we have one test that tests table_type, we should be okay.
We only revert CTAS -> create+insert statement but keeping the NULL changes. In the first PR, I didn't know it was possible to enforce schema nulls using CTAS until yijun showed it to me. Note we haven't removed any nullable schema tests that were added earlier. |
Please answer these questions before submitting your pull requests. Thanks!
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-912320: The behavior of
save_as_table(mode='overwrite')
is inconsistent between v1.5.1 and v1.6.1 #1046, #SNOW-911327Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
In PR SNOW-817445: Fix dataframe writer save_as_table allow nulls #895 we started using create-table-insert-values pattern instead of using a CTAS pattern for saving dataframes. This is causing issues for multiple users so we are using CTAS while also respecting nullable columns. The tests added before also work for the correctness of this change.