Skip to content

Commit 0ebbafd

Browse files
topper-123jreback
authored andcommitted
DEPR: Add deprecated index attribute names to deprecation list (pandas-dev#21125)
1 parent e80cc43 commit 0ebbafd

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

doc/source/whatsnew/v0.23.1.txt

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ Documentation Changes
4444
Bug Fixes
4545
~~~~~~~~~
4646

47+
- tab completion on :class:`Index` in IPython no longer outputs deprecation warnings (:issue:`21125`)
48+
4749
Groupby/Resample/Rolling
4850
^^^^^^^^^^^^^^^^^^^^^^^^
4951

pandas/core/accessor.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
class DirNamesMixin(object):
1414
_accessors = frozenset([])
15-
_deprecations = frozenset(['asobject'])
15+
_deprecations = frozenset(
16+
['asobject', 'base', 'data', 'flags', 'itemsize', 'strides'])
1617

1718
def _dir_deletions(self):
1819
""" delete unwanted __dir__ for this object """

pandas/tests/indexes/test_base.py

+11
Original file line numberDiff line numberDiff line change
@@ -2088,6 +2088,17 @@ def test_get_duplicates_deprecated(self):
20882088
with tm.assert_produces_warning(FutureWarning):
20892089
index.get_duplicates()
20902090

2091+
def test_tab_complete_warning(self, ip):
2092+
# https://github.com/pandas-dev/pandas/issues/16409
2093+
pytest.importorskip('IPython', minversion="6.0.0")
2094+
from IPython.core.completer import provisionalcompleter
2095+
2096+
code = "import pandas as pd; idx = pd.Index([1, 2])"
2097+
ip.run_code(code)
2098+
with tm.assert_produces_warning(None):
2099+
with provisionalcompleter('ignore'):
2100+
list(ip.Completer.completions('idx.', 4))
2101+
20912102

20922103
class TestMixedIntIndex(Base):
20932104
# Mostly the tests from common.py for which the results differ

0 commit comments

Comments
 (0)