Skip to content

Commit e742fe4

Browse files
committed
Fix flake8 issues.
1 parent b00eb77 commit e742fe4

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

pandas/core/arrays/categorical.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2531,21 +2531,24 @@ def _delegate_method(self, name, *args, **kwargs):
25312531

25322532
@property
25332533
def categorical(self):
2534-
warn("`Series.cat.categorical` has been deprecated. Use the attributes on 'Series.cat' directly instead.",
2534+
warn("`Series.cat.categorical` has been deprecated. Use the "
2535+
"attributes on 'Series.cat' directly instead.",
25352536
FutureWarning,
25362537
stacklevel=2)
25372538
return self._parent
25382539

25392540
@property
25402541
def name(self):
2541-
warn("`Series.cat.name` has been deprecated. Use `Series.name` instead.",
2542+
warn("`Series.cat.name` has been deprecated. Use `Series.name` "
2543+
"instead.",
25422544
FutureWarning,
25432545
stacklevel=2)
25442546
return self._name
25452547

25462548
@property
25472549
def index(self):
2548-
warn("`Series.cat.index` has been deprecated. Use `Series.index` instead.",
2550+
warn("`Series.cat.index` has been deprecated. Use `Series.index` "
2551+
"instead.",
25492552
FutureWarning,
25502553
stacklevel=2)
25512554
return self._index

pandas/tests/series/test_api.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,11 @@ def test_tab_completion(self):
245245

246246
def test_tab_completion_with_categorical(self):
247247
# test the tab completion display
248-
ok_for_cat = ['categories', 'codes', 'ordered', 'set_categories',
249-
'add_categories', 'remove_categories',
250-
'rename_categories', 'reorder_categories',
251-
'remove_unused_categories', 'as_ordered', 'as_unordered']
248+
ok_for_cat = ['name', 'index', 'categorical', 'categories', 'codes',
249+
'ordered', 'set_categories', 'add_categories',
250+
'remove_categories', 'rename_categories',
251+
'reorder_categories', 'remove_unused_categories',
252+
'as_ordered', 'as_unordered']
252253

253254
def get_dir(s):
254255
results = [r for r in s.cat.__dir__() if not r.startswith('_')]

pandas/tests/test_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ def test_deprecate_option(self):
251251
KeyError,
252252
message="Nonexistent option didn't raise KeyError"):
253253
self.cf.get_option('foo')
254-
254+
for wa in w:
255+
print(wa, wa.source, wa.line, wa.lineno)
255256
assert len(w) == 1 # should have raised one warning
256257
assert 'deprecated' in str(w[-1]) # we get the default message
257258

0 commit comments

Comments
 (0)