snowflakedb / snowflakedb/snowflake-connector-python

SNOW-349018: Use @~/ as the stage, or allow the user to pass in a stage, in the write_pandas function

Open
#689 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature status-triage_done triaged
Dominant language
Python
Stars
730
Forks
574
Avg merge
5h 45m
Merged PRs (30d)
16

Description

What is the current behavior?

https://github.com/snowflakedb/snowflake-connector-python/blob/master/src/snowflake/connector/pandas_tools.py#L138-L149

We generate a stage name then use create temporary stage to create it in the current schema.

What is the desired behavior?

I think users should be able to upload a file to a stage even if they don't have access to create a stage in the current schema. For example, a user could upload to their personal stage (@~/), then copy into a table they have write access to.

To enable this, we should use the @~/ as the stage instead of creating a temporary stage, and tear down any uploaded files afterwards. Or, we should at least allow the user to pass in an existing stage_name.

How would this improve snowflake-connector-python?

I think this Improves the general usability of the pandas_tools.write_pandas function.

References, Other Background

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/snowflake/connector/pandas_tools.py at the referenced lines and trace how write_pandas creates and uses its temporary stage. Compare the personal-stage and caller-supplied-stage options, including uploaded-file cleanup; done means users without permission to create a stage in the current schema can complete the upload and load flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python, sql
Domain
backend-api-design, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.