Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the error message for div_by_zero test #5718

Merged
merged 1 commit into from
Jun 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions integration_tests/src/main/python/arithmetic_ops_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,13 +798,17 @@ def _test_div_by_zero(ansi_mode, expr):
ansi_conf = {'spark.sql.ansi.enabled': ansi_mode == 'ansi'}
data_gen = lambda spark: two_col_df(spark, IntegerGen(), IntegerGen(min_val=0, max_val=0), length=1)
div_by_zero_func = lambda spark: data_gen(spark).selectExpr(expr)
if is_before_spark_320():
err_message = 'java.lang.ArithmeticException: divide by zero'
elif is_before_spark_330():
err_message = 'SparkArithmeticException: divide by zero'
else:
err_message = 'SparkArithmeticException: Division by zero'

if ansi_mode == 'ansi':
assert_gpu_and_cpu_error(df_fun=lambda spark: div_by_zero_func(spark).collect(),
conf=ansi_conf,
error_message=
'java.lang.ArithmeticException: divide by zero' if is_before_spark_320() else
'SparkArithmeticException: divide by zero')
error_message=err_message)
else:
assert_gpu_and_cpu_are_equal_collect(div_by_zero_func, ansi_conf)

Expand Down