|
78 | 78 | from pandas.core.series import Series |
79 | 79 | from pandas.core.util.numba_ import ( |
80 | 80 | NUMBA_FUNC_CACHE, |
81 | | - check_kwargs_and_nopython, |
82 | | - get_jit_arguments, |
83 | | - jit_user_function, |
| 81 | + generate_numba_func, |
84 | 82 | split_for_numba, |
85 | | - validate_udf, |
86 | 83 | ) |
87 | 84 |
|
88 | 85 | from pandas.plotting import boxplot_frame_groupby |
@@ -493,12 +490,8 @@ def _transform_general( |
493 | 490 | """ |
494 | 491 |
|
495 | 492 | if engine == "numba": |
496 | | - nopython, nogil, parallel = get_jit_arguments(engine_kwargs) |
497 | | - check_kwargs_and_nopython(kwargs, nopython) |
498 | | - validate_udf(func) |
499 | | - cache_key = (func, "groupby_transform") |
500 | | - numba_func = NUMBA_FUNC_CACHE.get( |
501 | | - cache_key, jit_user_function(func, nopython, nogil, parallel) |
| 493 | + numba_func, cache_key = generate_numba_func( |
| 494 | + func, engine_kwargs, kwargs, "groupby_transform" |
502 | 495 | ) |
503 | 496 |
|
504 | 497 | klass = type(self._selected_obj) |
@@ -1377,12 +1370,8 @@ def _transform_general( |
1377 | 1370 | obj = self._obj_with_exclusions |
1378 | 1371 | gen = self.grouper.get_iterator(obj, axis=self.axis) |
1379 | 1372 | if engine == "numba": |
1380 | | - nopython, nogil, parallel = get_jit_arguments(engine_kwargs) |
1381 | | - check_kwargs_and_nopython(kwargs, nopython) |
1382 | | - validate_udf(func) |
1383 | | - cache_key = (func, "groupby_transform") |
1384 | | - numba_func = NUMBA_FUNC_CACHE.get( |
1385 | | - cache_key, jit_user_function(func, nopython, nogil, parallel) |
| 1373 | + numba_func, cache_key = generate_numba_func( |
| 1374 | + func, engine_kwargs, kwargs, "groupby_transform" |
1386 | 1375 | ) |
1387 | 1376 | else: |
1388 | 1377 | fast_path, slow_path = self._define_paths(func, *args, **kwargs) |
|
0 commit comments