Skip to content

Commit fbea19b

Browse files
sfc-gh-mvashishthasfc-gh-jkew
authored andcommitted
SNOW-2249808: Turn off AutoSwitchBackend if set to True by default. (#3631)
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
1 parent 149e7df commit fbea19b

File tree

4 files changed

+30
-19
lines changed

4 files changed

+30
-19
lines changed

src/snowflake/snowpark/modin/plugin/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,7 @@
170170
)
171171
from modin.config import AutoSwitchBackend # isort: skip # noqa: E402
172172

173-
if (
174-
AutoSwitchBackend.get() is not AutoSwitchBackend.default
175-
and AutoSwitchBackend.get_value_source() is not ValueSource.DEFAULT
176-
):
173+
if AutoSwitchBackend.get_value_source() is ValueSource.DEFAULT:
177174
AutoSwitchBackend.disable()
178175

179176
# Hybrid Mode Registration

tests/integ/modin/hybrid/auto_switch_backend/test_default_not_changed.py

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright (c) 2012-2025 Snowflake Computing Inc. All rights reserved.
3+
#
4+
5+
6+
def test_importing_plugin_always_turns_off_auto_switch_backend():
7+
"""Test that importing snowflake.snowpark.modin.plugin always turns AutoSwitchBackend off."""
8+
9+
from modin.config import AutoSwitchBackend
10+
11+
import snowflake.snowpark.modin.plugin # noqa: F401
12+
13+
assert AutoSwitchBackend.get() is False
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# Copyright (c) 2012-2025 Snowflake Computing Inc. All rights reserved.
3+
#
4+
5+
6+
def test_auto_switch_backend_user_sets_to_False():
7+
"""Test that importing snowflake.snowpark.modin.plugin does not override user's AutoSwitchBackend setting"""
8+
9+
from modin.config import AutoSwitchBackend
10+
11+
AutoSwitchBackend.disable()
12+
assert AutoSwitchBackend.get() is False
13+
14+
import snowflake.snowpark.modin.plugin # noqa: F401
15+
16+
assert AutoSwitchBackend.get() is False

0 commit comments

Comments
 (0)