Skip to content

Commit

Permalink
enable thread-safe session for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-aalam committed Oct 5, 2024
1 parent 5e447fd commit 7e7b47a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/snowflake/snowpark/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,6 @@ def __init__(
self._conf = self.RuntimeConfig(self, options or {})
self._runtime_version_from_requirement: str = None
self._temp_table_auto_cleaner: TempTableAutoCleaner = TempTableAutoCleaner(self)

_logger.info("Snowpark Session information: %s", self._session_info)

def __enter__(self):
Expand Down
2 changes: 2 additions & 0 deletions tests/integ/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ def session(
session = (
Session.builder.configs(db_parameters)
.config("local_testing", local_testing_mode)
# Enable thread safe session for testing
.config("PYTHON_SNOWPARK_ENABLE_THREAD_SAFE_SESSION", True)
.create()
)
session.sql_simplifier_enabled = sql_simplifier_enabled
Expand Down
10 changes: 0 additions & 10 deletions tests/integ/test_multithreading.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@
from tests.utils import IS_IN_STORED_PROC, IS_LINUX, IS_WINDOWS, TestFiles, Utils


@pytest.fixture(scope="module", autouse=True)
def session(db_parameters):
session_ = (
Session.builder.configs(db_parameters)
.config("PYTHON_SNOWPARK_ENABLE_THREAD_SAFE_SESSION", True)
.create()
)
yield session_


def test_concurrent_select_queries(session):
def run_select(session_, thread_id):
df = session_.sql(f"SELECT {thread_id} as A")
Expand Down

0 comments on commit 7e7b47a

Please sign in to comment.