Skip to content

Commit

Permalink
SNOW-1848793: Enable large query breakdown by min version (#2730)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-aalam authored Dec 9, 2024
1 parent 0a64ef8 commit e57cb78
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/snowflake/snowpark/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@
_PYTHON_SNOWPARK_REDUCE_DESCRIBE_QUERY_ENABLED = (
"PYTHON_SNOWPARK_REDUCE_DESCRIBE_QUERY_ENABLED"
)
_PYTHON_SNOWPARK_USE_LARGE_QUERY_BREAKDOWN_OPTIMIZATION = (
"PYTHON_SNOWPARK_USE_LARGE_QUERY_BREAKDOWN_OPTIMIZATION"
_PYTHON_SNOWPARK_USE_LARGE_QUERY_BREAKDOWN_OPTIMIZATION_VERSION = (
"PYTHON_SNOWPARK_USE_LARGE_QUERY_BREAKDOWN_OPTIMIZATION_VERSION"
)
_PYTHON_SNOWPARK_LARGE_QUERY_BREAKDOWN_COMPLEXITY_UPPER_BOUND = (
"PYTHON_SNOWPARK_LARGE_QUERY_BREAKDOWN_COMPLEXITY_UPPER_BOUND"
Expand Down Expand Up @@ -619,10 +619,8 @@ def __init__(
_PYTHON_SNOWPARK_ENABLE_QUERY_COMPILATION_STAGE, False
)
)
self._large_query_breakdown_enabled: bool = (
self._conn._get_client_side_session_parameter(
_PYTHON_SNOWPARK_USE_LARGE_QUERY_BREAKDOWN_OPTIMIZATION, False
)
self._large_query_breakdown_enabled: bool = self.is_feature_enabled_for_version(
_PYTHON_SNOWPARK_USE_LARGE_QUERY_BREAKDOWN_OPTIMIZATION_VERSION
)
self._ast_enabled: bool = self._conn._get_client_side_session_parameter(
_PYTHON_SNOWPARK_USE_AST, _PYTHON_SNOWPARK_USE_AST_DEFAULT_VALUE
Expand Down
7 changes: 6 additions & 1 deletion tests/unit/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,12 @@ def test_session_builder_app_name_existing_invalid_json_query_tag():
],
)
@pytest.mark.parametrize(
"parameter_name", ["_auto_clean_up_temp_table_enabled", "_cte_optimization_enabled"]
"parameter_name",
[
"_auto_clean_up_temp_table_enabled",
"_cte_optimization_enabled",
"_large_query_breakdown_enabled",
],
)
def test_parameter_version(version_value, expected_parameter_value, parameter_name):
fake_server_connection = mock.create_autospec(ServerConnection)
Expand Down

0 comments on commit e57cb78

Please sign in to comment.