Skip to content

Commit f91b716

Browse files
author
tp
committed
comments addressed for adding nan_funcs to _cython_table
1 parent 5ec7e18 commit f91b716

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

pandas/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def tz_aware_fixture(request):
158158
# GH 21123
159159
params=list(sorted(pd.core.base.SelectionMixin._cython_table.items(),
160160
key=lambda x: x[0].__name__)),
161-
ids=lambda x: "({}-{!r})".format(x[0].__name__, x[1]),
161+
ids=lambda x: "({}-{!r})_fixture".format(x[0].__name__, x[1]),
162162
)
163163
def cython_table_items(request):
164164
"""

pandas/tests/frame/test_apply.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -1072,10 +1072,11 @@ def test_agg_function_input(self, df, cython_table_items):
10721072
# etc.
10731073
# GH21123
10741074
np_func, str_func = cython_table_items
1075-
1076-
tm.assert_almost_equal(df.agg(np_func),
1077-
df.agg(str_func),
1078-
)
1079-
tm.assert_almost_equal(df.agg(np_func, axis=1),
1080-
df.agg(str_func, axis=1),
1081-
)
1075+
if str_func in ('cumprod', 'cumsum'):
1076+
tm.assert_frame_equal(df.agg(np_func), df.agg(str_func))
1077+
tm.assert_frame_equal(df.agg(np_func, axis=1),
1078+
df.agg(str_func, axis=1))
1079+
else:
1080+
tm.assert_series_equal(df.agg(np_func), df.agg(str_func))
1081+
tm.assert_series_equal(df.agg(np_func, axis=1),
1082+
df.agg(str_func, axis=1))

pandas/tests/series/test_apply.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ def test_agg_function_input(self, series, cython_table_items):
604604
# GH21123
605605
np_func, str_func = cython_table_items
606606

607-
tm.assert_almost_equal(series.agg(np_func),
608-
series.agg(str_func),
609-
)
607+
if str_func in ('cumprod', 'cumsum'):
608+
tm.assert_series_equal(series.agg(np_func), series.agg(str_func))
609+
else:
610+
tm.assert_almost_equal(series.agg(np_func), series.agg(str_func))

0 commit comments

Comments
 (0)