diff --git a/doc/source/whatsnew/v0.25.2.rst b/doc/source/whatsnew/v0.25.2.rst index 1cdf213d81a74..76c7ad208865d 100644 --- a/doc/source/whatsnew/v0.25.2.rst +++ b/doc/source/whatsnew/v0.25.2.rst @@ -100,7 +100,8 @@ Other ^^^^^ - Compatibility with Python 3.8 in :meth:`DataFrame.query` (:issue:`27261`) -- +- Fix to ensure that tab-completion in an IPython console does not raise + warnings for deprecated attributes (:issue:`27900`). .. _whatsnew_0.252.contributors: diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 9aced760725be..400d8647ced92 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -150,7 +150,7 @@ class NDFrame(PandasObject, SelectionMixin): _internal_names_set = set(_internal_names) # type: Set[str] _accessors = set() # type: Set[str] _deprecations = frozenset( - ["as_blocks", "blocks", "is_copy"] + ["as_blocks", "blocks", "is_copy", "ftypes", "ix"] ) # type: FrozenSet[str] _metadata = [] # type: List[str] _is_copy = None diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 680976f44ee1e..0e4c9ffcc5858 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -225,7 +225,7 @@ class Index(IndexOpsMixin, PandasObject): """ # tolist is not actually deprecated, just suppressed in the __dir__ - _deprecations = DirNamesMixin._deprecations | frozenset(["tolist"]) + _deprecations = DirNamesMixin._deprecations | frozenset(["tolist", "dtype_str"]) # To hand over control to subclasses _join_precedence = 1 diff --git a/pandas/core/series.py b/pandas/core/series.py index 9f31e185fe41a..8394766fb0286 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -56,7 +56,7 @@ import pandas as pd from pandas.core import algorithms, base, generic, nanops, ops -from pandas.core.accessor import CachedAccessor +from pandas.core.accessor import CachedAccessor, DirNamesMixin from pandas.core.arrays import ExtensionArray, SparseArray from pandas.core.arrays.categorical import Categorical, CategoricalAccessor from pandas.core.arrays.sparse import SparseAccessor @@ -178,8 +178,11 @@ class Series(base.IndexOpsMixin, generic.NDFrame): _metadata = ["name"] _accessors = {"dt", "cat", "str", "sparse"} # tolist is not actually deprecated, just suppressed in the __dir__ - _deprecations = generic.NDFrame._deprecations | frozenset( - ["asobject", "reshape", "get_value", "set_value", "valid", "tolist"] + _deprecations = ( + generic.NDFrame._deprecations + | DirNamesMixin._deprecations + | frozenset(["asobject", "reshape", "get_value", "set_value", "valid"]) + | frozenset(["ftype", "real", "imag", "tolist"]) ) # Override cache_readonly bc Series is mutable