Repository navigation
Fix pyspark.pandas coerce+nullable failure case reporting - #2256
Merged
cosmicbboy merged 4 commits intoApr 4, 2026
Merged
cosmicbboy merged 4 commits into
cosmicbboy merged 4 commits into
Conversation
Detect coercion-introduced nulls for pyspark.pandas and raise datatype coercion errors with failure cases. Add regression test for issue unionai-oss#2150. Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2256 +/- ##
==========================================
+ Coverage 83.97% 83.99% +0.02%
==========================================
Files 138 138
Lines 11114 11130 +16
==========================================
+ Hits 9333 9349 +16
Misses 1781 1781 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Move coercion-guard branch coverage tests into existing pandas schema tests to increase patch coverage for array backend changes. Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
Contributor
Author
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
cosmicbboy
approved these changes
Apr 4, 2026
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.

This PR fixes issue #2150 for pandera.pandas used with pyspark.pandas.
When coerce=True and
ullable=True, invalid values in numeric coercion paths were being converted to nulls and not reported as coercion failure cases.
Changes:
Reproduction:
ullable=True) were not reported.
Validation:
Note: Spark ANSI mode setting was environment specific for this run. With ANSI enabled, pyspark can raise NumberFormatException before pandera collects failure cases in some tests. Disabling ANSI aligns behavior with the expected pandas on Spark coercion semantics used by this test module.