Skip to content

Commit e57cb78

Browse files
authored
SNOW-1848793: Enable large query breakdown by min version (#2730)
1 parent 0a64ef8 commit e57cb78

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/snowflake/snowpark/session.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@
247247
_PYTHON_SNOWPARK_REDUCE_DESCRIBE_QUERY_ENABLED = (
248248
"PYTHON_SNOWPARK_REDUCE_DESCRIBE_QUERY_ENABLED"
249249
)
250-
_PYTHON_SNOWPARK_USE_LARGE_QUERY_BREAKDOWN_OPTIMIZATION = (
251-
"PYTHON_SNOWPARK_USE_LARGE_QUERY_BREAKDOWN_OPTIMIZATION"
250+
_PYTHON_SNOWPARK_USE_LARGE_QUERY_BREAKDOWN_OPTIMIZATION_VERSION = (
251+
"PYTHON_SNOWPARK_USE_LARGE_QUERY_BREAKDOWN_OPTIMIZATION_VERSION"
252252
)
253253
_PYTHON_SNOWPARK_LARGE_QUERY_BREAKDOWN_COMPLEXITY_UPPER_BOUND = (
254254
"PYTHON_SNOWPARK_LARGE_QUERY_BREAKDOWN_COMPLEXITY_UPPER_BOUND"
@@ -619,10 +619,8 @@ def __init__(
619619
_PYTHON_SNOWPARK_ENABLE_QUERY_COMPILATION_STAGE, False
620620
)
621621
)
622-
self._large_query_breakdown_enabled: bool = (
623-
self._conn._get_client_side_session_parameter(
624-
_PYTHON_SNOWPARK_USE_LARGE_QUERY_BREAKDOWN_OPTIMIZATION, False
625-
)
622+
self._large_query_breakdown_enabled: bool = self.is_feature_enabled_for_version(
623+
_PYTHON_SNOWPARK_USE_LARGE_QUERY_BREAKDOWN_OPTIMIZATION_VERSION
626624
)
627625
self._ast_enabled: bool = self._conn._get_client_side_session_parameter(
628626
_PYTHON_SNOWPARK_USE_AST, _PYTHON_SNOWPARK_USE_AST_DEFAULT_VALUE

tests/unit/test_session.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,12 @@ def test_session_builder_app_name_existing_invalid_json_query_tag():
630630
],
631631
)
632632
@pytest.mark.parametrize(
633-
"parameter_name", ["_auto_clean_up_temp_table_enabled", "_cte_optimization_enabled"]
633+
"parameter_name",
634+
[
635+
"_auto_clean_up_temp_table_enabled",
636+
"_cte_optimization_enabled",
637+
"_large_query_breakdown_enabled",
638+
],
634639
)
635640
def test_parameter_version(version_value, expected_parameter_value, parameter_name):
636641
fake_server_connection = mock.create_autospec(ServerConnection)

0 commit comments

Comments
 (0)