[SPARK-54476][PYTHON][TEST] Add coverage test for try_mod#55964
Open
fallintoplace wants to merge 1 commit into
Open
[SPARK-54476][PYTHON][TEST] Add coverage test for try_mod#55964fallintoplace wants to merge 1 commit into
fallintoplace wants to merge 1 commit into
Conversation
| assertDataFrameEqual([Row(True)], actual) | ||
|
|
||
| def test_try_mod_function(self): | ||
| df = self.spark.createDataFrame([(6000, 15), (3, 2), (1234, 0)], ["a", "b"]) |
Contributor
There was a problem hiding this comment.
this seems already been tested as a doc-test
https://github.com/apache/spark/blob/master/python/pyspark/sql/functions/builtin.py#L762-L774
Contributor
Author
There was a problem hiding this comment.
Good point @zhengruifeng, thanks. I missed that the main try_mod behavior is already covered by the doctest. The only additional coverage here is the Column + literal path, which is probably too small to justify a separate test. I will close this PR unless you think explicit coverage in test_functions.py is still useful for SPARK-54476.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this pull request?
This PR adds PySpark SQL function coverage for
try_modintest_functions.py. The test covers column-name operands,Columnplus literal operands, and division by zero returning null.Why are the changes needed?
SPARK-54476 tracks adding
try_modcoverage intest_functions.py. This adds direct coverage for the PySpark function wrapper.Does this PR introduce any user-facing change?
No.
How was this patch tested?
Was this patch authored or co-authored using generative AI tooling?
Generated-by: GPT-5.5 xhigh