SNOW-2912540: inline _create_temp_stage and _create_temp_file_format into analyzer_utils - #4308
Open
sfc-gh-fpawlowski wants to merge 3 commits into
Conversation
…into analyzer_utils Removes the dependency on these private snowflake-connector-python functions (previously imported from connector.pandas_tools). Ports the implementation from universal-driver PR #518 directly into Snowpark so the connector no longer needs to expose staging helpers as part of its public surface. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 tasks
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Aug 6, 2026
3 tasks
sfc-gh-fpawlowski
marked this pull request as ready for review
August 17, 2026 17:58
sfc-gh-fpawlowski
requested review from
sfc-gh-aling,
sfc-gh-bkogan and
sfc-gh-jzeng
and removed request for
a team
August 17, 2026 17:58
…inline-pandas-staging-helpers
…ned pandas staging helpers black never ran on the ported code (4 blocks needed line-wrapping). The two cursor.execute(..., _force_qmark_paramstyle=True) calls also fail pyright: SnowflakeCursor.execute's two @overload stubs in snowflake-connector-python never declare _force_qmark_paramstyle, only the real implementation signature does. That gap was invisible while this code lived in the connector package; porting it into analyzer_utils.py exposes it to Snowpark's own pyright run.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## SNOW-2912540-remove-connector-shims #4308 +/- ##
=======================================================================
- Coverage 89.08% 80.99% -8.10%
=======================================================================
Files 170 170
Lines 44624 44663 +39
Branches 7675 7677 +2
=======================================================================
- Hits 39755 36174 -3581
- Misses 3721 6969 +3248
- Partials 1148 1520 +372 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.

Ports the
_create_temp_stageand_create_temp_file_formatimplementations from the Universal Driver connector (PR snowflake-eng/drivers#518) directly into Snowpark'sanalyzer_utils.py, removing the dependency on these privatesnowflake.connector.pandas_toolssymbols.Changes:
analyzer_utils.py: Remove the three connector imports (_create_temp_stage,_create_temp_file_format,build_location_helper). Add local implementations of all staging helpers:_qualify_name/build_location_helper,_pandas_generate_temp_name,_pandas_create_temp_object,_stage_sql,_file_format_sql,_create_temp_stage,_create_temp_file_format._create_temp_file_formatcall site inwrite_arrow: the local impl maps compression internally (like PR SNOW-667858:to_pandaswill only convertTimestampTypes to a native pandas date format, and notDateTypes #518), so the caller no longer pre-maps viacompression_map[compression].black-format the ported code, and suppress apyrightoverload error on the twocursor.execute(..., _force_qmark_paramstyle=True)calls in_pandas_create_temp_object:_force_qmark_paramstyleis declared only onSnowflakeCursor.execute's real implementation signature in snowflake-connector-python, not on either of its two@overloadstubs — a latent stub gap invisible while this code lived inside the connector package, now exposed since it lives in Snowpark's own pyright-checked source tree.Companion: snowflake-eng/drivers#518 (which implements the same functions in the UD connector for its own
write_pandasflow — the two implementations are kept in sync).Checklist
Stack (via Graphite)
🤖 Generated with Claude Code