-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-53112][PYTHON][TESTS][FOLLOW-UP] Remove some tests for Non-ANSI #52466
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
Conversation
| with self.assertRaises(Exception): | ||
| F.make_timestamp_ntz(date=df_dt.date) | ||
|
|
||
| # Test 17: Invalid data types - should raise exception for invalid string to int cast |
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.
How about changing it to
with self.sql_conf({"spark.sql.ansi.enabled": True}):
# Test 17: Invalid data types - should raise exception for invalid string to int cast
with self.assertRaises(Exception):
self.spark.range(1).select(
F.make_timestamp_ntz(
F.lit("invalid"), F.lit(5), F.lit(22), F.lit(10), F.lit(30), F.lit(0)
)
).collect()
....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.
I feel we don't need to check this from pyspark's, it is guaranteed by spark sql.
|
merged to master |
Yicong-Huang
left a comment
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.
Makes sense!
### What changes were proposed in this pull request? remove some newly added tests which failed in non-ansi see https://github.com/apache/spark/actions/runs/18025276597/job/51291154866 ``` ====================================================================== FAIL [1.563s]: test_make_timestamp_ntz (pyspark.sql.tests.test_functions.FunctionsTests.test_make_timestamp_ntz) Comprehensive test cases for make_timestamp_ntz with various arguments and edge cases. ---------------------------------------------------------------------- Traceback (most recent call last): File "/__w/spark/spark/python/pyspark/sql/tests/test_functions.py", line 999, in test_make_timestamp_ntz with self.assertRaises(Exception): AssertionError: Exception not raised ---------------------------------------------------------------------- ``` ### Why are the changes needed? to make non-ansi schedule job happy ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? manually check ### Was this patch authored or co-authored using generative AI tooling? no Closes apache#52466 from zhengruifeng/remove_ansi_test. Authored-by: Ruifeng Zheng <[email protected]> Signed-off-by: Ruifeng Zheng <[email protected]>
What changes were proposed in this pull request?
remove some newly added tests which failed in non-ansi
see https://github.com/apache/spark/actions/runs/18025276597/job/51291154866
Why are the changes needed?
to make non-ansi schedule job happy
Does this PR introduce any user-facing change?
no
How was this patch tested?
manually check
Was this patch authored or co-authored using generative AI tooling?
no