snowflakedb / snowflake-connector-python

Snowflake Connector for Python
https://pypi.python.org/pypi/snowflake-connector-python/
Apache License 2.0
568 stars 456 forks source link

feat: allow snowflake cursor on write_pandas. #1958

Open yassun7010 opened 1 month ago

yassun7010 commented 1 month ago

Please answer these questions before submitting your pull requests. Thanks!

  1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes #1957

  2. Fill out the following pre-review checklist:

    • [x] I am adding a new automated test(s) to verify correctness of my new code
    • [ ] I am adding new logging messages
    • [ ] I am adding a new telemetry message
    • [ ] I am modifying authorization mechanisms
    • [ ] I am adding new credentials
    • [ ] I am modifying OCSP code
    • [ ] I am adding a new dependency
  3. Please describe how your code solves the related issue.

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

with snowflake_conn.cursor() as cursor:
    df = cursor.execute("...").fetch_pandas_all()
    write_pandas(cursor, df)
github-actions[bot] commented 1 month ago

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

yassun7010 commented 1 month ago

I have read the CLA Document and I hereby sign the CLA