Skip to content

Commit 89b3a9e

Browse files
Backport PR pandas-dev#28524: COMPAT: ensure no warnings on tab completion with Jedi 0.15 (pandas-dev#28524)
1 parent 8cd7357 commit 89b3a9e

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

doc/source/whatsnew/v0.25.2.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ Other
100100
^^^^^
101101

102102
- Compatibility with Python 3.8 in :meth:`DataFrame.query` (:issue:`27261`)
103-
-
103+
- Fix to ensure that tab-completion in an IPython console does not raise
104+
warnings for deprecated attributes (:issue:`27900`).
104105

105106
.. _whatsnew_0.252.contributors:
106107

pandas/core/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class NDFrame(PandasObject, SelectionMixin):
150150
_internal_names_set = set(_internal_names) # type: Set[str]
151151
_accessors = set() # type: Set[str]
152152
_deprecations = frozenset(
153-
["as_blocks", "blocks", "is_copy"]
153+
["as_blocks", "blocks", "is_copy", "ftypes", "ix"]
154154
) # type: FrozenSet[str]
155155
_metadata = [] # type: List[str]
156156
_is_copy = None

pandas/core/indexes/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ class Index(IndexOpsMixin, PandasObject):
225225
"""
226226

227227
# tolist is not actually deprecated, just suppressed in the __dir__
228-
_deprecations = DirNamesMixin._deprecations | frozenset(["tolist"])
228+
_deprecations = DirNamesMixin._deprecations | frozenset(["tolist", "dtype_str"])
229229

230230
# To hand over control to subclasses
231231
_join_precedence = 1

pandas/core/series.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
import pandas as pd
5858
from pandas.core import algorithms, base, generic, nanops, ops
59-
from pandas.core.accessor import CachedAccessor
59+
from pandas.core.accessor import CachedAccessor, DirNamesMixin
6060
from pandas.core.arrays import ExtensionArray, SparseArray
6161
from pandas.core.arrays.categorical import Categorical, CategoricalAccessor
6262
from pandas.core.arrays.sparse import SparseAccessor
@@ -178,8 +178,11 @@ class Series(base.IndexOpsMixin, generic.NDFrame):
178178
_metadata = ["name"]
179179
_accessors = {"dt", "cat", "str", "sparse"}
180180
# tolist is not actually deprecated, just suppressed in the __dir__
181-
_deprecations = generic.NDFrame._deprecations | frozenset(
182-
["asobject", "reshape", "get_value", "set_value", "valid", "tolist"]
181+
_deprecations = (
182+
generic.NDFrame._deprecations
183+
| DirNamesMixin._deprecations
184+
| frozenset(["asobject", "reshape", "get_value", "set_value", "valid"])
185+
| frozenset(["ftype", "real", "imag", "tolist"])
183186
)
184187

185188
# Override cache_readonly bc Series is mutable

0 commit comments

Comments
 (0)