TST: assert_extension_array_equal is inconsistent in how precision is handled #23709
Labels
ExtensionArray
Extending pandas with custom dtypes or arrays.
Testing
pandas testing functions or related to the test suite
Milestone
Code Sample, a copy-pastable example if possible
Setup:
By default,
assert_frame_equal
will not fail on a difference in precision that's as slight as what's above, and will only detect the difference ifcheck_exact=True
is passed:However, when extension arrays are introduced, which causes
assert_frame_equal
to dispatch toassert_extension_array_equal
, this difference in precision is detected by default:Proposed Solution
Looking at the source code for
assert_extension_array_equal
, it does not accept any of the keyword arguments that theassert_*_equal
functions take in regards to precision:pandas/pandas/util/testing.py
Lines 1192 to 1198 in e413c49
I'd like to add
check_exact
,check_less_precise
, andcheck_dtype
parameters toassert_extension_array_equal
with the same defaults as the otherassert_*_equal
functions.Note that this would resolve #23605, which is the source of my example.
cc @TomAugspurger : Thoughts on this? Is there a reason we'd want
check_exact
style checking by default?The text was updated successfully, but these errors were encountered: