Skip to content

Commit

Permalink
DEPR: Add deprecated index attribute names to deprecation list (#21125)
Browse files Browse the repository at this point in the history
(cherry picked from commit 0ebbafd)
  • Loading branch information
topper-123 authored and jorisvandenbossche committed Jun 9, 2018
1 parent 04f5a6e commit ea5fdb6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doc/source/whatsnew/v0.23.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Documentation Changes
Bug Fixes
~~~~~~~~~

- tab completion on :class:`Index` in IPython no longer outputs deprecation warnings (:issue:`21125`)

Groupby/Resample/Rolling
^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
3 changes: 2 additions & 1 deletion pandas/core/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

class DirNamesMixin(object):
_accessors = frozenset([])
_deprecations = frozenset(['asobject'])
_deprecations = frozenset(
['asobject', 'base', 'data', 'flags', 'itemsize', 'strides'])

def _dir_deletions(self):
""" delete unwanted __dir__ for this object """
Expand Down
11 changes: 11 additions & 0 deletions pandas/tests/indexes/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2088,6 +2088,17 @@ def test_get_duplicates_deprecated(self):
with tm.assert_produces_warning(FutureWarning):
index.get_duplicates()

def test_tab_complete_warning(self, ip):
# https://github.com/pandas-dev/pandas/issues/16409
pytest.importorskip('IPython', minversion="6.0.0")
from IPython.core.completer import provisionalcompleter

code = "import pandas as pd; idx = pd.Index([1, 2])"
ip.run_code(code)
with tm.assert_produces_warning(None):
with provisionalcompleter('ignore'):
list(ip.Completer.completions('idx.', 4))


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

0 comments on commit ea5fdb6

Please sign in to comment.