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

Fixed Failing tests in arithmetic_ops_tests for Spark 4.0.0 [databricks] #11044

Merged
merged 9 commits into from
Jun 25, 2024

Conversation

razajafri
Copy link
Collaborator

This PR fixes arithmetic_ops_tests failures

We are explicitly setting the spark.sql.ansi.enabled to false as that is how our tests are written.
There are various changes to the Exception messages and types for some methods that were also fixed.

fixes #11006

@razajafri razajafri requested a review from revans2 June 12, 2024 21:42
@razajafri razajafri changed the title Fixed Failing tests in arithmetic_ops_tests [databricks] Fixed Failing tests in arithmetic_ops_tests for Spark 4.0.0 [databricks] Jun 13, 2024
@razajafri
Copy link
Collaborator Author

@revans2 do you have any more questions that I can help answer?

revans2
revans2 previously approved these changes Jun 13, 2024
@razajafri
Copy link
Collaborator Author

I have modified this PR to disable ansi mode per test instead of a global conf. The advantage is that we can take that off if we need to once we modify tests to handle the ansi mode.

@razajafri
Copy link
Collaborator Author

Build

@razajafri
Copy link
Collaborator Author

@mythrocks Can you PTAL

@razajafri
Copy link
Collaborator Author

@revans2 can you PTAL

revans2
revans2 previously approved these changes Jun 14, 2024
mythrocks
mythrocks previously approved these changes Jun 14, 2024
Copy link
Collaborator

@mythrocks mythrocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm 👍, pending a couple of clarifications.

@mythrocks
Copy link
Collaborator

P.S. Using an annotation makes this very neat. Good idea.

@razajafri
Copy link
Collaborator Author

build

@razajafri
Copy link
Collaborator Author

I am looking into the premerge failure.

@razajafri razajafri dismissed stale reviews from mythrocks and revans2 via 0a6fbf3 June 14, 2024 21:33
@razajafri
Copy link
Collaborator Author

build

@razajafri
Copy link
Collaborator Author

@mythrocks I think I found the problem. It was because I was setting the ansi mode to True if it wasn't set in the test which caused problem in other tests

@razajafri
Copy link
Collaborator Author

build


def is_allowing_any_non_gpu():
return _allow_any_non_gpu

def get_non_gpu_allowed():
return _non_gpu_allowed

def get_per_test_ansi_mode():
Copy link
Collaborator

@mythrocks mythrocks Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the logic problem could have been avoided if the names of the variable and function were better. Note that the annotation is a "negative" (ansi_mode_disabled).

Suggested change
def get_per_test_ansi_mode():
def is_per_test_ansi_mode_enabled():

Likewise, the variable should probably be named _per_test_ansi_mode_enabled.

It is confusing to read, as it currently stands.

@@ -16,6 +16,7 @@

allow_non_gpu_databricks = pytest.mark.allow_non_gpu_databricks
allow_non_gpu = pytest.mark.allow_non_gpu
ansi_mode_disabled = pytest.mark.ansi_mode_disabled
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I look at this, it would be better to use an imperative/active voice for directives:

Suggested change
ansi_mode_disabled = pytest.mark.ansi_mode_disabled
disable_ansi_mode = pytest.mark.disable_ansi_mode

Notice that all the other annotations are in active voice.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P.S. Apologies for the churn.

mythrocks
mythrocks previously approved these changes Jun 14, 2024
Copy link
Collaborator

@mythrocks mythrocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm +1 for the change. It would be good to rename the annotation and the associated function/variable, to avoid confusion.

@razajafri
Copy link
Collaborator Author

build

mythrocks
mythrocks previously approved these changes Jun 14, 2024
Copy link
Collaborator

@mythrocks mythrocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@razajafri
Copy link
Collaborator Author

build

@razajafri
Copy link
Collaborator Author

Premerge failed sure to insufficient capacity of databricks clusters with the required conf

@razajafri
Copy link
Collaborator Author

Build

@mythrocks
Copy link
Collaborator

Looks like it's the cache tests that are still failing:

2024-06-15T06:46:16.0592319Z [2024-06-15T06:45:35.581Z] [2024-06-15T06:40:43.135Z] [gw3]^[[36m [ 10%] ^[[0m^[[31mFAILED^[[0m ../../src/main/python/cache_test.py::test_cache_expand_exec[{'spark.sql.inMemoryColumnarStorage.enableVectorizedReader': 'true'}-Timestamp][DATAGEN_SEED=1718433500, TZ=UTC, INJECT_OOM, IGNORE_ORDER]

Odd. This should have been fixed by 0a6fbf3. I'll review the logic again, and kick off another build.

This handles cases like `cache_test.py` which should run with the default conf for `spark.sql.ansi.enabled`.
@mythrocks
Copy link
Collaborator

Build

@razajafri razajafri merged commit 86a905a into NVIDIA:branch-24.08 Jun 25, 2024
44 of 45 checks passed
@razajafri razajafri deleted the SP-11006-arithmetic_tests branch June 25, 2024 05:54
@sameerz sameerz added the Spark 4.0+ Spark 4.0+ issues label Jun 25, 2024
SurajAralihalli pushed a commit to SurajAralihalli/spark-rapids that referenced this pull request Jul 12, 2024
…ks] (NVIDIA#11044)

* Fixed arithmetic_ops_tests

* Signing off

Signed-off-by: Raza Jafri <[email protected]>

* Added a mechanism to add ansi mode per test

* Reverted unnecessary change to spark_init_internal.py

* Corrected the year in the licence

* Only set ansi conf to false when ansi_mode_disabled is set

* Addressed review comments

* Fixed the method name

* Update integration_tests/src/main/python/conftest.py

This handles cases like `cache_test.py` which should run with the default conf for `spark.sql.ansi.enabled`.

---------

Signed-off-by: Raza Jafri <[email protected]>
Co-authored-by: MithunR <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Spark 4.0+ Spark 4.0+ issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix test failures in arithmetic_ops_test.py
4 participants