@@ -224,8 +224,11 @@ def apply(
224224 if not isinstance (data , np .ndarray ):
225225 if data .empty :
226226 return data .copy () # mimic apply_empty_result()
227+ engine_kwargs = (
228+ decorator .engine_kwargs if hasattr (decorator , "engine_kwargs" ) else {}
229+ )
227230 NumbaExecutionEngine .validate_values_for_numba_raw_false (
228- data , get_jit_arguments (decorator . engine_kwargs )
231+ data , get_jit_arguments (engine_kwargs )
229232 )
230233
231234 return NumbaExecutionEngine .apply_raw_false (
@@ -407,8 +410,6 @@ def frame_apply(
407410 raw : bool = False ,
408411 result_type : str | None = None ,
409412 by_row : Literal [False , "compat" ] = "compat" ,
410- engine : str = "python" ,
411- engine_kwargs : dict [str , bool ] | None = None ,
412413 args = None ,
413414 kwargs = None ,
414415) -> FrameApply :
@@ -432,8 +433,6 @@ def frame_apply(
432433 raw = raw ,
433434 result_type = result_type ,
434435 by_row = by_row ,
435- engine = engine ,
436- engine_kwargs = engine_kwargs ,
437436 args = args ,
438437 kwargs = kwargs ,
439438 )
@@ -450,8 +449,6 @@ def __init__(
450449 result_type : str | None ,
451450 * ,
452451 by_row : Literal [False , "compat" , "_compat" ] = "compat" ,
453- engine : str = "python" ,
454- engine_kwargs : dict [str , bool ] | None = None ,
455452 args ,
456453 kwargs ,
457454 ) -> None :
@@ -464,9 +461,6 @@ def __init__(
464461 self .args = args or ()
465462 self .kwargs = kwargs or {}
466463
467- self .engine = engine
468- self .engine_kwargs = {} if engine_kwargs is None else engine_kwargs
469-
470464 if result_type not in [None , "reduce" , "broadcast" , "expand" ]:
471465 raise ValueError (
472466 "invalid value for result_type, must be one "
@@ -1085,8 +1079,6 @@ def __init__(
10851079 result_type : str | None ,
10861080 * ,
10871081 by_row : Literal [False , "compat" ] = False ,
1088- engine : str = "python" ,
1089- engine_kwargs : dict [str , bool ] | None = None ,
10901082 args ,
10911083 kwargs ,
10921084 ) -> None :
@@ -1098,8 +1090,6 @@ def __init__(
10981090 raw ,
10991091 result_type ,
11001092 by_row = by_row ,
1101- engine = engine ,
1102- engine_kwargs = engine_kwargs ,
11031093 args = args ,
11041094 kwargs = kwargs ,
11051095 )
@@ -1174,7 +1164,7 @@ def apply(self) -> DataFrame | Series:
11741164
11751165 # raw
11761166 elif self .raw :
1177- return self .apply_raw (engine = self . engine , engine_kwargs = self . engine_kwargs )
1167+ return self .apply_raw ()
11781168
11791169 return self .apply_standard ()
11801170
@@ -1247,7 +1237,7 @@ def apply_empty_result(self):
12471237 else :
12481238 return self .obj .copy ()
12491239
1250- def apply_raw (self , engine = "python" , engine_kwargs = None ):
1240+ def apply_raw (self ):
12511241 """apply to the values as a numpy array"""
12521242
12531243 def wrap_function (func ):
@@ -1674,11 +1664,6 @@ def agg_or_apply_list_like(
16741664 def agg_or_apply_dict_like (
16751665 self , op_name : Literal ["agg" , "apply" ]
16761666 ) -> DataFrame | Series :
1677- from pandas .core .groupby .generic import (
1678- DataFrameGroupBy ,
1679- SeriesGroupBy ,
1680- )
1681-
16821667 assert op_name in ["agg" , "apply" ]
16831668
16841669 obj = self .obj
@@ -1693,14 +1678,6 @@ def agg_or_apply_dict_like(
16931678 selected_obj = obj ._selected_obj
16941679 selection = obj ._selection
16951680
1696- is_groupby = isinstance (obj , (DataFrameGroupBy , SeriesGroupBy ))
1697-
1698- # Numba Groupby engine/engine-kwargs passthrough
1699- if is_groupby :
1700- engine = self .kwargs .get ("engine" , None )
1701- engine_kwargs = self .kwargs .get ("engine_kwargs" , None )
1702- kwargs .update ({"engine" : engine , "engine_kwargs" : engine_kwargs })
1703-
17041681 with com .temp_setattr (
17051682 obj , "as_index" , True , condition = hasattr (obj , "as_index" )
17061683 ):
0 commit comments