Skip to content

Commit 3bf8993

Browse files
Matt Hagyjreback
Matt Hagy
authored andcommitted
Revise attribute/method consistency check to skip known inconsistencies
1 parent 033e42d commit 3bf8993

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

pandas/tests/groupby/test_groupby.py

+33-2
Original file line numberDiff line numberDiff line change
@@ -3836,13 +3836,44 @@ def test_groupby_whitelist(self):
38363836
'nsmallest',
38373837
])
38383838

3839+
# TODO: Fix these inconsistencies between attribute and method names
3840+
inconsistently_named = frozenset([
3841+
'tshift',
3842+
'any',
3843+
'dtypes',
3844+
'idxmax',
3845+
'all',
3846+
'fillna',
3847+
'rank',
3848+
'quantile',
3849+
'cummax',
3850+
'take',
3851+
'corr',
3852+
'cummin',
3853+
'diff',
3854+
'plot',
3855+
'pct_change',
3856+
'skew',
3857+
'hist',
3858+
'bfill',
3859+
'cov',
3860+
'boxplot',
3861+
'describe',
3862+
'corrwith',
3863+
'idxmin',
3864+
'ffill',
3865+
'mad',
3866+
'dtype',
3867+
'unique'
3868+
])
3869+
38393870
for obj, whitelist in zip((df, s), (df_whitelist, s_whitelist)):
38403871
gb = obj.groupby(df.letters)
38413872
self.assertEqual(whitelist, gb._apply_whitelist)
38423873
for m in whitelist:
38433874
f = getattr(type(gb), m)
3844-
# TODO: Fix inconsistencies between attribute and method names
3845-
# self.assertEqual(f.__name__, m)
3875+
if m not in inconsistently_named:
3876+
self.assertEqual(f.__name__, m)
38463877

38473878
AGG_FUNCTIONS = ['sum', 'prod', 'min', 'max', 'median', 'mean', 'skew',
38483879
'mad', 'std', 'var', 'sem']

0 commit comments

Comments
 (0)