-
Notifications
You must be signed in to change notification settings - Fork 235
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
Remove test checks for Spark versions before 3.2.0 #11316
Open
sameerz
wants to merge
5
commits into
NVIDIA:branch-24.12
Choose a base branch
from
sameerz:branch-24.10-remove_3_1_test_checks
base: branch-24.12
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
42712ac
remove conditions for spark 3.1.x in tests
f0824a3
remove conditions for spark 3.1.x in tests
ca2a12e
Remove is_before_spark_320
336d7a9
Resolving merge conflicts
0707778
Merge branch 'branch-24.10' of https://github.com/nvidia/spark-rapids…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,19 +86,7 @@ def test_cast_string_date_valid_format(): | |
] | ||
values_string_to_data = invalid_values_string_to_date + valid_values_string_to_date | ||
|
||
# Spark 320+ and databricks support Ansi mode when casting string to date | ||
# This means an exception will be thrown when casting invalid string to date on Spark 320+ or databricks | ||
# test Spark versions < 3.2.0 and non databricks, ANSI mode | ||
@pytest.mark.skipif(not is_before_spark_320(), reason="ansi cast(string as date) throws exception only in 3.2.0+ or db") | ||
def test_cast_string_date_invalid_ansi_before_320(): | ||
data_rows = [(v,) for v in values_string_to_data] | ||
assert_gpu_and_cpu_are_equal_collect( | ||
lambda spark: spark.createDataFrame(data_rows, "a string").select(f.col('a').cast(DateType())), | ||
conf={'spark.rapids.sql.hasExtendedYearValues': 'false', | ||
'spark.sql.ansi.enabled': 'true'}, ) | ||
|
||
# test Spark versions >= 320 and databricks, ANSI mode, valid values | ||
@pytest.mark.skipif(is_before_spark_320(), reason="Spark versions(< 320) not support Ansi mode when casting string to date") | ||
def test_cast_string_date_valid_ansi(): | ||
data_rows = [(v,) for v in valid_values_string_to_date] | ||
assert_gpu_and_cpu_are_equal_collect( | ||
|
@@ -107,7 +95,6 @@ def test_cast_string_date_valid_ansi(): | |
'spark.sql.ansi.enabled': 'true'}) | ||
|
||
# test Spark versions >= 320, ANSI mode | ||
@pytest.mark.skipif(is_before_spark_320(), reason="ansi cast(string as date) throws exception only in 3.2.0+") | ||
@pytest.mark.parametrize('invalid', invalid_values_string_to_date) | ||
def test_cast_string_date_invalid_ansi(invalid): | ||
assert_gpu_and_cpu_error( | ||
|
@@ -118,7 +105,7 @@ def test_cast_string_date_invalid_ansi(invalid): | |
|
||
|
||
# test try_cast in Spark versions >= 320 and < 340 | ||
@pytest.mark.skipif(is_before_spark_320() or is_spark_340_or_later() or is_databricks113_or_later(), reason="try_cast only in Spark 3.2+") | ||
@pytest.mark.skipif(is_before_spark_340() or is_databricks113_or_later(), reason="try_cast only in Spark 3.2+") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this supposed to be is_spark_340_or_later instead of is_before_spark_340? |
||
@allow_non_gpu('ProjectExec', 'TryCast') | ||
@pytest.mark.parametrize('invalid', invalid_values_string_to_date) | ||
def test_try_cast_fallback(invalid): | ||
|
@@ -162,15 +149,13 @@ def test_cast_string_ts_valid_format(data_gen): | |
'spark.rapids.sql.castStringToTimestamp.enabled': 'true'}) | ||
|
||
@allow_non_gpu('ProjectExec', 'Cast', 'Alias') | ||
@pytest.mark.skipif(is_before_spark_320(), reason="Only in Spark 3.2.0+ do we have issues with extended years") | ||
def test_cast_string_date_fallback(): | ||
assert_gpu_fallback_collect( | ||
# Cast back to String because this goes beyond what python can support for years | ||
lambda spark : unary_op_df(spark, StringGen('([0-9]|-|\\+){4,12}')).select(f.col('a').cast(DateType()).cast(StringType())), | ||
'Cast') | ||
|
||
@allow_non_gpu('ProjectExec', 'Cast', 'Alias') | ||
@pytest.mark.skipif(is_before_spark_320(), reason="Only in Spark 3.2.0+ do we have issues with extended years") | ||
def test_cast_string_timestamp_fallback(): | ||
assert_gpu_fallback_collect( | ||
# Cast back to String because this goes beyond what python can support for years | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_neg_dec_scale_bug_version should also be updated, as it's using
spark_version()
comparisons directly against 3.1.1 and 3.1.3.