Skip to content

Commit

Permalink
Update test_cast_neg_to_decimal_err to work with Databricks 10.4 where (
Browse files Browse the repository at this point in the history
#5579)

exception is different

Signed-off-by: Thomas Graves <tgraves@nvidia.com>
  • Loading branch information
tgravescs authored May 21, 2022
1 parent 1fd1aef commit 64c123e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions integration_tests/src/main/python/arithmetic_ops_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from marks import ignore_order, incompat, approximate_float, allow_non_gpu
from pyspark.sql.types import *
from pyspark.sql.types import IntegralType
from spark_session import with_cpu_session, with_gpu_session, with_spark_session, is_before_spark_320, is_before_spark_330, is_databricks91_or_later, is_spark_330_or_later
from spark_session import with_cpu_session, with_gpu_session, with_spark_session, is_before_spark_320, is_before_spark_330, is_databricks91_or_later, is_databricks104_or_later, is_spark_330_or_later
import pyspark.sql.functions as f
from datetime import timedelta

Expand Down Expand Up @@ -298,8 +298,9 @@ def test_cast_neg_to_decimal_err():
# -12 cannot be represented as decimal(7,7)
data_gen = _decimal_gen_7_7
exception_content = "Decimal(compact,-120000000,20,0}) cannot be represented as Decimal(7, 7)"
exception_str = "java.lang.ArithmeticException: " + exception_content if is_before_spark_330() else \
"org.apache.spark.SparkArithmeticException: " + exception_content
exception_str = "java.lang.ArithmeticException: " + exception_content if is_before_spark_330() \
and not is_databricks104_or_later() else "org.apache.spark.SparkArithmeticException: " \
+ exception_content

assert_gpu_and_cpu_error(
lambda spark : unary_op_df(spark, data_gen).selectExpr(
Expand Down

0 comments on commit 64c123e

Please sign in to comment.