Skip to content

Commit

Permalink
Update test_div_overflow_exception_when_ansi test for Spark-3.3 (#5601)
Browse files Browse the repository at this point in the history
[databricks]

Signed-off-by: Niranjan Artal <nartal@nvidia.com>
  • Loading branch information
nartal1 authored May 24, 2022
1 parent a12eccc commit 4d69482
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion integration_tests/src/main/python/arithmetic_ops_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,11 +836,13 @@ def _get_div_overflow_df(spark, expr):
@pytest.mark.parametrize('ansi_enabled', ['false', 'true'])
def test_div_overflow_exception_when_ansi(expr, ansi_enabled):
ansi_conf = {'spark.sql.ansi.enabled': ansi_enabled}
exception_str = "java.lang.ArithmeticException: Overflow in integral divide" if is_before_spark_330() \
else "org.apache.spark.SparkArithmeticException: Overflow in integral divide"
if ansi_enabled == 'true':
assert_gpu_and_cpu_error(
df_fun=lambda spark: _get_div_overflow_df(spark, expr).collect(),
conf=ansi_conf,
error_message='java.lang.ArithmeticException: Overflow in integral divide')
error_message=exception_str)
else:
assert_gpu_and_cpu_are_equal_collect(
func=lambda spark: _get_div_overflow_df(spark, expr),
Expand Down

0 comments on commit 4d69482

Please sign in to comment.