Skip to content

Commit

Permalink
Only set ansi conf to false when ansi_mode_disabled is set
Browse files Browse the repository at this point in the history
  • Loading branch information
razajafri committed Jun 14, 2024
1 parent 5d2c938 commit 0a6fbf3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions integration_tests/src/main/python/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ def get_non_gpu_allowed():
return _non_gpu_allowed

def get_per_test_ansi_mode():
if _per_test_ansi_mode is None:
return False
else:
return _per_test_ansi_mode
return _per_test_ansi_mode

def get_validate_execs_in_gpu_plan():
return _validate_execs_in_gpu_plan
Expand Down Expand Up @@ -224,9 +221,7 @@ def pytest_runtest_setup(item):
non_gpu = item.get_closest_marker('allow_non_gpu')
per_test_ansi_mode = item.get_closest_marker('ansi_mode_disabled')
if per_test_ansi_mode:
_per_test_ansi_mode = False
else:
_per_test_ansi_mode = True
_per_test_ansi_mode = "false"

if non_gpu_databricks:
if is_databricks_runtime():
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/src/main/python/spark_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def with_spark_session(func, conf={}):
reset_spark_session_conf()
_add_job_description(conf)
# Only set the ansi conf if not set by the test explicitly by setting the value in the dict
if "spark.sql.ansi.enabled" not in conf:
if "spark.sql.ansi.enabled" not in conf and get_per_test_ansi_mode() is not None:
conf["spark.sql.ansi.enabled"] = get_per_test_ansi_mode()
_set_all_confs(conf)
ret = func(_spark)
Expand Down

0 comments on commit 0a6fbf3

Please sign in to comment.