SNOW-1184290: Skip CREATE TABLE IF NOT EXISTS when auto_create_table#2791
Open
sfc-gh-turbaszek wants to merge 7 commits intomainfrom
Open
SNOW-1184290: Skip CREATE TABLE IF NOT EXISTS when auto_create_table#2791sfc-gh-turbaszek wants to merge 7 commits intomainfrom
sfc-gh-turbaszek wants to merge 7 commits intomainfrom
Conversation
…False write_pandas() with auto_create_table=False and overwrite=True was executing CREATE TABLE IF NOT EXISTS before TRUNCATE, which requires OWNERSHIP privilege on the table. When auto_create_table=False, the table is assumed to already exist so only TRUNCATE is needed. Changed the condition guarding CREATE TABLE from `if auto_create_table or overwrite` to `if auto_create_table` in both the sync and async implementations. Added unit tests to verify the SQL statements emitted for each combination of overwrite and auto_create_table. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…False write_pandas() with auto_create_table=False and overwrite=True was executing CREATE TABLE IF NOT EXISTS before TRUNCATE, which requires OWNERSHIP privilege on the table. When auto_create_table=False, the table is assumed to already exist so only TRUNCATE is needed. Changed the condition guarding CREATE TABLE from `if auto_create_table or overwrite` to `if auto_create_table` in both the sync and async implementations. Added unit tests to verify the SQL statements emitted for each combination of overwrite and auto_create_table. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused `call` import and apply black formatting to test_pandas_tools.py - Add corresponding async unit tests in test/unit/aio/test_pandas_tools_async.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
63be2e7 to
45698aa
Compare
…False write_pandas() with auto_create_table=False and overwrite=True was executing CREATE TABLE IF NOT EXISTS before TRUNCATE, which requires OWNERSHIP privilege on the table. When auto_create_table=False, the table is assumed to already exist so only TRUNCATE is needed. Changed the condition guarding CREATE TABLE from `if auto_create_table or overwrite` to `if auto_create_table` in both the sync and async implementations. Added unit tests to verify the SQL statements emitted for each combination of overwrite and auto_create_table. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The unit tests were failing in non-pandas tox environments because the module-level pandas import raised MissingDependencyError. Use pytest.importorskip to skip collection and add @pytest.mark.pandas + @pytest.mark.unit to route tests to the pandas-parallel environment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
write_pandas() with auto_create_table=False and overwrite=True was executing CREATE TABLE IF NOT EXISTS before TRUNCATE, which requires OWNERSHIP privilege on the table. When auto_create_table=False, the table is assumed to already exist so only TRUNCATE is needed.
Changed the condition guarding CREATE TABLE from
if auto_create_table or overwritetoif auto_create_tablein both the sync and async implementations. Added unit tests to verify the SQL statements emitted for each combination of overwrite and auto_create_table.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 #NNNN
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Please write a short description of how your code change solves the related issue.
(Optional) PR for stored-proc connector: