Skip to content
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-1457704: Allows write_pandas to pass Cursor in addition to Connection. #1957

Open
yassun7010 opened this issue May 31, 2024 · 1 comment · May be fixed by #1958
Open

SNOW-1457704: Allows write_pandas to pass Cursor in addition to Connection. #1957

yassun7010 opened this issue May 31, 2024 · 1 comment · May be fixed by #1958
Assignees
Labels
feature status-triage_done Initial triage done, will be further handled by the driver team

Comments

@yassun7010
Copy link

yassun7010 commented May 31, 2024

What is the current behavior?

You can pass Connection to write_pandas, but not Cursor.

with snowflake_conn.cursor() as cursor:
    df = cursor.execute("...").fetch_pandas_all()
    write_pandas(cursor.connection, df) # <- See this

What is the desired behavior?

Allow Cursor to be passed to write_pandas.

with snowflake_conn.cursor() as cursor:
    df = cursor.execute("...").fetch_pandas_all()
    write_pandas(cursor, df)

How would this improve snowflake-connector-python?

The write_pandas process can be described more intuitively while dealing with cursors using with.

References and other background

This is a minor modification, but we believe it is a natural writing permit given the definition of connection cursor in the PEP 249 – Python Database API.

@github-actions github-actions bot changed the title Allows write_pandas to pass Cursor in addition to Connection. SNOW-1457704: Allows write_pandas to pass Cursor in addition to Connection. May 31, 2024
@yassun7010 yassun7010 linked a pull request May 31, 2024 that will close this issue
7 tasks
@sfc-gh-dszmolka sfc-gh-dszmolka added status-triage_done Initial triage done, will be further handled by the driver team and removed needs triage labels Jun 4, 2024
@sfc-gh-dszmolka
Copy link
Contributor

hi - thanks for submitting this with us and especially for the PR submission! we'll review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants