From 7c22750230884db4bd3e2df448bf3736f4abd7c5 Mon Sep 17 00:00:00 2001 From: Afroz Alam Date: Mon, 14 Oct 2024 14:31:57 -0700 Subject: [PATCH] SNOW-1418523 Make Session thread safe (#2312) --- .github/pull_request_template.md | 3 +- .github/workflows/threadsafe-check.yml | 36 ++ CHANGELOG.md | 5 +- .../compiler/large_query_breakdown.py | 9 +- .../_internal/compiler/plan_compiler.py | 14 +- .../snowpark/_internal/server_connection.py | 63 +- src/snowflake/snowpark/_internal/telemetry.py | 18 + .../_internal/temp_table_auto_cleaner.py | 22 +- src/snowflake/snowpark/_internal/udf_utils.py | 12 +- src/snowflake/snowpark/_internal/utils.py | 10 + src/snowflake/snowpark/dataframe.py | 5 +- src/snowflake/snowpark/session.py | 356 ++++++----- src/snowflake/snowpark/stored_procedure.py | 11 +- src/snowflake/snowpark/udaf.py | 9 +- src/snowflake/snowpark/udf.py | 9 +- src/snowflake/snowpark/udtf.py | 9 +- tests/integ/conftest.py | 23 +- .../integ/scala/test_file_operation_suite.py | 17 +- tests/integ/test_multithreading.py | 582 ++++++++++++++++++ tests/integ/test_telemetry.py | 26 + tests/integ/test_temp_table_cleanup.py | 13 +- .../compiler/test_large_query_breakdown.py | 7 +- tests/unit/test_server_connection.py | 1 + tests/unit/test_udf_utils.py | 2 + 24 files changed, 1033 insertions(+), 229 deletions(-) create mode 100644 .github/workflows/threadsafe-check.yml create mode 100644 tests/integ/test_multithreading.py diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f8741e619c3..0f191f6b06c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,7 +6,7 @@ Please answer these questions before creating your pull request. Thanks!