Skip to content

Commit 7b79ae0

Browse files
authored
SNOW-1830248: Add back CTE parameter test (#2846)
<!--- Please answer these questions before creating your pull request. Thanks! ---> 1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR. <!--- In this section, please add a Snowflake Jira issue number. Note that if a corresponding GitHub issue exists, you should still include the Snowflake Jira issue number. For example, for GitHub issue #1400, you should add "SNOW-1335071" here. ---> Fixes SNOW-1830248 2. Fill out the following pre-review checklist: - [ ] I am adding a new automated test(s) to verify correctness of my new code - [ ] If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing - [ ] I am adding new logging messages - [ ] I am adding a new telemetry message - [ ] I am adding new credentials - [ ] I am adding a new dependency - [ ] If this is a new feature/behavior, I'm adding the Local Testing parity changes. - [x] I acknowledge that I have ensured my changes to be thread-safe. Follow the link for more information: [Thread-safe Developer Guidelines](https://github.com/snowflakedb/snowpark-python/blob/main/CONTRIBUTING.md#thread-safe-development) 3. Please describe how your code solves the related issue. We can add it back now since server side is ready.
1 parent 30e5f9e commit 7b79ae0

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tests/integ/test_session.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from snowflake.snowpark.session import (
2626
_PYTHON_SNOWPARK_ELIMINATE_NUMERIC_SQL_VALUE_CAST_ENABLED,
2727
_PYTHON_SNOWPARK_USE_SQL_SIMPLIFIER_STRING,
28+
_PYTHON_SNOWPARK_USE_CTE_OPTIMIZATION_VERSION,
2829
_active_sessions,
2930
_get_active_session,
3031
_get_active_sessions,
@@ -706,13 +707,14 @@ def test_cte_optimization_enabled_on_session(session, db_parameters):
706707
new_session.cte_optimization_enabled = default_value
707708
assert new_session.cte_optimization_enabled is default_value
708709

709-
# TODO SNOW-1830248: add back the test when the parameter is available on the server side
710-
# parameters = db_parameters.copy()
711-
# parameters["session_parameters"] = {
712-
# _PYTHON_SNOWPARK_USE_CTE_OPTIMIZATION_VERSION: get_version() if default_value else ""
713-
# }
714-
# with Session.builder.configs(parameters).create() as new_session2:
715-
# assert new_session2.cte_optimization_enabled is not default_value
710+
parameters = db_parameters.copy()
711+
parameters["session_parameters"] = {
712+
_PYTHON_SNOWPARK_USE_CTE_OPTIMIZATION_VERSION: get_version()
713+
if default_value
714+
else ""
715+
}
716+
with Session.builder.configs(parameters).create() as new_session2:
717+
assert new_session2.cte_optimization_enabled is default_value
716718

717719

718720
@pytest.mark.skipif(IS_IN_STORED_PROC, reason="Can't create a session in SP")

0 commit comments

Comments
 (0)