Skip to content

BUG/DEPR: the deprecation of util.testing fails for direct imports #30735

Closed
@jorisvandenbossche

Description

@jorisvandenbossche
In [1]: from pandas.util.testing import assert_frame_equal  
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-79d99d902fdd> in <module>
----> 1 from pandas.util.testing import assert_frame_equal

ImportError: cannot import name 'assert_frame_equal' from 'pandas.util.testing' (/home/joris/scipy/pandas/pandas/util/testing/__init__.py)

It works when accessing from top-level import:

In [3]: pd.util.testing.assert_frame_equal
/home/joris/miniconda3/envs/dev/bin/ipython:1: FutureWarning: pandas._testing.assert_frame_equal is deprecated. Please use pandas.testing.assert_frame_equal instead.
  #!/home/joris/miniconda3/envs/dev/bin/python
Out[3]: <function pandas._testing.assert_frame_equal(left, right, check_dtype=True, check_index_type='equiv', check_column_type='equiv', check_frame_type=True, check_less_precise=False, check_names=True, by_blocks=False, check_exact=False, check_datetimelike_compat=False, check_categorical=True, check_like=False, obj='DataFrame')>

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeprecateFunctionality to remove in pandasTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions