Skip to content

SNOW-2912540: inline _create_temp_stage and _create_temp_file_format into analyzer_utils - #4308

Draft
sfc-gh-fpawlowski wants to merge 1 commit into
SNOW-2912540-remove-connector-shimsfrom
SNOW-2912540-inline-pandas-staging-helpers
Draft

SNOW-2912540: inline _create_temp_stage and _create_temp_file_format into analyzer_utils#4308
sfc-gh-fpawlowski wants to merge 1 commit into
SNOW-2912540-remove-connector-shimsfrom
SNOW-2912540-inline-pandas-staging-helpers

Conversation

@sfc-gh-fpawlowski

@sfc-gh-fpawlowski sfc-gh-fpawlowski commented Aug 6, 2026

Copy link
Copy Markdown

Ports the `_create_temp_stage` and `_create_temp_file_format` implementations from the Universal Driver connector (PR snowflake-eng/drivers#518) directly into Snowpark's `analyzer_utils.py`, removing the dependency on these private `snowflake.connector.pandas_tools` symbols.

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`.
  • Fix the `_create_temp_file_format` call site in `write_arrow`: the local impl maps compression internally (like PR SNOW-667858: to_pandas will only convert TimestampTypes to a native pandas date format, and not DateTypes #518), so the caller no longer pre-maps via `compression_map[compression]`.

Companion: snowflake-eng/drivers#518 (which implements the same functions in the UD connector for its own `write_pandas` flow — the two implementations are kept in sync).


Stack (via Graphite)

🤖 Generated with Claude Code

…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>
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.

1 participant