snowflakedb / snowflake-connector-python

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

SNOW-1362666: improve random string generation #2034

Closed sfc-gh-aling closed 3 months ago

sfc-gh-aling commented 3 months 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 SNOW-1362666

  2. Fill out the following pre-review checklist:

    • [ ] 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.

    Please write a short description of how your code change solves the related issue.

https://github.com/snowflakedb/snowflake-connector-python/issues/1937

the previous string generation is affected by the global seed which can cause collision. this affects feature like write pandas which uses this function to create temp stage. with the fix, it greatly lower the possibility of having string collision

  1. (Optional) PR for stored-proc connector:

https://github.com/snowflakedb/Stored-Proc-Python-Connector/pull/181