Skip to content

BUG: panda._testing.assert_interval_array_equal no longer checks "exact" parameter #49198

Open
@venaturum

Description

@venaturum

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

# pandas >=1.2

import pandas as pd

pd._testing.asserters.assert_interval_array_equal(
    pd.arrays.IntervalArray.from_tuples([(1,2)]),
    pd.arrays.IntervalArray.from_tuples([(1.0,2.0)]),
    exact=False
)

Issue Description

Granted, the functionality in the _testing module is not considered public, however the functionality is not aligned with it's docstring.

exact : bool or {'equiv'}, default 'equiv'
Whether to check the Index class, dtype and inferred_type
are identical. If 'equiv', then RangeIndex can be substituted for
Int64Index as well.

In pandas 1.1 the following passes:

pd._testing.assert_interval_array_equal(
    pd.arrays.IntervalArray.from_tuples([(1,2)]),
    pd.arrays.IntervalArray.from_tuples([(1.0,2.0)]),
    exact=False,
)

pd._testing.assert_interval_array_equal (pandas 1.1)

I believe the code above for pandas >= 1.2 should work but doesn't

Expected Behavior

Ideally the assertion passes

Installed Versions

INSTALLED VERSIONS

commit : 91111fd
python : 3.9.0.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.19041
machine : AMD64
processor : Intel64 Family 6 Model 158 Stepping 10, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_Australia.1252

pandas : 1.5.1
numpy : 1.23.4
pytz : 2022.5
dateutil : 2.8.2
setuptools : 65.5.0
pip : 22.2.2
Cython : None
pytest : 6.2.5
hypothesis : None
sphinx : 4.3.2
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 7.34.0
pandas_datareader: None
bs4 : 4.11.1
bottleneck : None
brotli : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.5.3
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : None
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
zstandard : None
tzdata : None

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIntervalInterval data typeTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions