-
Notifications
You must be signed in to change notification settings - Fork 486
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-1362666: Multiple calls to write_pandas
with the same global random seed can result in stage name collisions
#1937
Comments
write_pandas
with the same global random seed can result in stage name collisionswrite_pandas
with the same global random seed can result in stage name collisions
Hello @scottfleming , Thanks for raising the issue, we are looking into it, will update. Regards, |
Hello @scottfleming , I tried to reproduce the issue with Python connector 3.6.0 and Python 3.11, but it did not throw any collision with stage names. Could you share the code snippet to reproduce the issue. `import random for logger_name in ['snowflake.connector', 'botocore', 'boto3']: def reset_seed(): def another_function(): def simulate_data_processing(connection):
Main functiondef main():
if name == "main": Regards, |
Hello @scottfleming , Closing the issue as we did not receive any response, and the issue is not getting reproduced. You can reopen when able to reproduce and provide the required artifacts. Regards, |
Python version
Python 3.11.6 (main, Oct 8 2023, 05:06:43) [GCC 13.2.0]
Operating system and processor architecture
Linux-6.6.16-linuxkit-aarch64-with-glibc2.38
Installed packages
What did you do?
I call
write_pandas
in a loop, but there's another function from a different package in that same loop that resets the global seed to a specific state (I recognize this is poor form and am working on a fix for that separately).The problem is that
snowflake-connector-python
's_create_temp_stage
function callsrandom_string
to generate temporary stage names, over which the user does not have control:snowflake-connector-python/src/snowflake/connector/pandas_tools.py
Line 95 in 8cdca67
random_string
in turn relies on therandom
module:snowflake-connector-python/test/randomize.py
Line 30 in 8cdca67
so if the user sets the seed deterministically outside the scope of calling
write_pandas
then this will result in stage name collisions throwing an opaque error such as the following:which triggers on line 81 in
_do_create_temp_stage
:snowflake-connector-python/src/snowflake/connector/pandas_tools.py
Line 81 in 8cdca67
What did you expect to see?
What I wish would have happened instead is that there would be one of the following:
stage_name
Can you set logging to DEBUG and collect the logs?
No response
The text was updated successfully, but these errors were encountered: