snowflake-connector-python icon indicating copy to clipboard operation
snowflake-connector-python copied to clipboard

feat: allow snowflake cursor on write_pandas.

Open ya7010 opened this issue 1 year ago • 2 comments

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)

ya7010 avatar May 31 '24 14:05 ya7010

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

github-actions[bot] avatar May 31 '24 14:05 github-actions[bot]

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

ya7010 avatar May 31 '24 14:05 ya7010