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 test_cast_neg_to_decimal_err to work with Databricks 10.4 where exception is different [databricks] #5579

Merged
merged 1 commit into from
May 21, 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
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