DEPR: be stricter in assert_almost_equal by jbrockmendel · Pull Request #52081 · pandas-dev/pandas (original) (raw)

This turns out to be a bit annoying while updating pyarrow tests for certain cases. For example, we have tests where we check that in the input you can have mixed NA-likes values. To assert the result, with this PR we need to construct the expected data with a consistent NA value. For small data it's typically straightforward to redefine it correctly. For larger data, that's a bit more annoying though.

One thing that also doesn't help is that we don't allow filling NAs with None (pyarrow uses None for object dtype arrays when converting to numpy/pandas): df.fillna(None) errors.

Should we also consider adding a keyword for relaxing this, so you can override the strict default for cases you don't care about the difference? (which was also suggested in #18463)