snowflakedb / snowflakedb/snowflake-connector-python
SNOW-1457704: Allows write_pandas to pass Cursor in addition to Connection.
Open
@sfc-gh-yixie is already working on this.
Since Jun 4, 2024.
feature
status-triage_done
- Dominant language
- Python
- Stars
- 730
- Forks
- 574
- Avg merge
- 5h 45m
- Merged PRs (30d)
- 16
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.