diff --git a/python/xorbits/_mars/dataframe/reduction/sum.py b/python/xorbits/_mars/dataframe/reduction/sum.py index 69cd4d534..ff8c81b6c 100644 --- a/python/xorbits/_mars/dataframe/reduction/sum.py +++ b/python/xorbits/_mars/dataframe/reduction/sum.py @@ -46,7 +46,14 @@ def sum_(value): def sum_series( - df, axis=None, skipna=True, level=None, min_count=0, combine_size=None, method=None + df, + axis=None, + skipna=True, + level=None, + min_count=0, + combine_size=None, + method=None, + **kwargs, # kwargs for compatible with numpy reduction ): op = DataFrameSum( axis=axis, @@ -69,6 +76,7 @@ def sum_dataframe( numeric_only=None, combine_size=None, method=None, + **kwargs, # kwargs for compatible with numpy reduction ): op = DataFrameSum( axis=axis, diff --git a/python/xorbits/_mars/dataframe/reduction/tests/test_reduction_execution.py b/python/xorbits/_mars/dataframe/reduction/tests/test_reduction_execution.py index de3127bf3..885dd36e6 100644 --- a/python/xorbits/_mars/dataframe/reduction/tests/test_reduction_execution.py +++ b/python/xorbits/_mars/dataframe/reduction/tests/test_reduction_execution.py @@ -771,6 +771,16 @@ def test_dataframe_aggregate(setup, check_ref_counts): ] data = pd.DataFrame(np.random.rand(20, 20)) + def realized_volatility(series): + print(series) + return np.sqrt(np.sum(series**2)) + + df = md.DataFrame(data) + result = df.agg(realized_volatility) + pd.testing.assert_series_equal( + result.execute().fetch(), data.agg(realized_volatility) + ) + df = md.DataFrame(data) result = df.agg(all_aggs) pd.testing.assert_frame_equal(result.execute().fetch(), data.agg(all_aggs))