ueshin opened a new pull request, #54146:
URL: https://github.com/apache/spark/pull/54146

   ### What changes were proposed in this pull request?
   
   Makes ops tests with "decimal_nan" columns ignore `NaN` vs. `None`.
   
   ### Why are the changes needed?
   
   pandas 3 made `assert_frame_equal` strictly check `NaN` vs. `None`.
   
   ```py
   >>> pdf = pd.DataFrame([decimal.Decimal(np.nan)])
   >>> psdf = ps.from_pandas(pdf)
   >>>
   >>> pdf
        0
   0  NaN
   >>> psdf
         0
   0  None
   ```
   
   - pandas < 3
   
   ```py
   >>> assert_frame_equal(pdf, psdf.to_pandas())
   <stdin>:1: FutureWarning: Mismatched null-like values NaN and None found. In 
a future version, pandas equality-testing functions (e.g. assert_frame_equal) 
will consider these not-matching and raise.
   ```
   
   - pandas == 3
   
   ```py
   >>> pd.__version__
   '3.0.0'
   >>> assert_frame_equal(pdf, psdf.to_pandas())
   Traceback (most recent call last):
   ...
   AssertionError: DataFrame.iloc[:, 0] (column name="0") are different
   
   DataFrame.iloc[:, 0] (column name="0") values are different (100.0 %)
   [index]: [0]
   [left]:  [NaN]
   [right]: [None]
   At positional index 0, first diff: NaN != None
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Updated the related tests.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to