Skip to content

Implemented NumbaExecutionEngine #61487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
aa42037
Implemented NumbaExecutionEngine
arthurlw May 23, 2025
db9f3b0
whatsnew
arthurlw May 23, 2025
4cb240d
precommit
arthurlw May 23, 2025
97d9063
Match function arguments
arthurlw May 24, 2025
69e0e35
Fix CI
arthurlw May 24, 2025
7365079
updated whatsnew
arthurlw May 28, 2025
c605857
Updated conditions and delegate method to numba.jit
arthurlw May 29, 2025
24a0615
Added try and except to catch ImportError
arthurlw Jun 3, 2025
b7a2ecb
Use import_optional_dependency to load Numba
arthurlw Jun 10, 2025
545db65
Merge branch 'main' into numba_execution_engine
arthurlw Jun 10, 2025
6f4fb50
Updated engine handling: normalizing numba to a fake decorator and up…
arthurlw Jun 17, 2025
221cf7c
Added check for empty engine_kwargs
arthurlw Jun 17, 2025
ed8dc7f
Moved checks from Apply.apply to NumbaExecutionEngine.apply
arthurlw Jun 17, 2025
65b9d32
Fixed CI, removed unused numba checks, updated raw=false condition, u…
arthurlw Jun 18, 2025
2703f86
Implement and refactor raw=False logic into NumbaExecutionEngine.apply
arthurlw Jun 19, 2025
347463e
Fix CI, update validate_values_for_numba params
arthurlw Jun 19, 2025
77eb146
Adjust error messages
arthurlw Jun 19, 2025
90f264f
Remove Numba-specific logic from FrameApply, added Series import to v…
arthurlw Jun 19, 2025
f8f1166
pre-commit
arthurlw Jun 19, 2025
bc2939b
Updated with reviewer suggestions and added axis normalizing
arthurlw Jun 21, 2025
176753b
Updated executor to accept decorator
arthurlw Jun 21, 2025
cf3e392
Fix CI and pre-commit
arthurlw Jun 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/source/whatsnew/v3.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Other enhancements
^^^^^^^^^^^^^^^^^^
- :class:`pandas.api.typing.FrozenList` is available for typing the outputs of :attr:`MultiIndex.names`, :attr:`MultiIndex.codes` and :attr:`MultiIndex.levels` (:issue:`58237`)
- :class:`pandas.api.typing.SASReader` is available for typing the output of :func:`read_sas` (:issue:`55689`)
- :meth:`DataFrame.apply` accepts Numba as an engine by passing the JIT decorator directly, e.g. ``df.apply(func, engine=numba.jit)`` (:issue:`61458`)
- Added :meth:`.Styler.to_typst` to write Styler objects to file, buffer or string in Typst format (:issue:`57617`)
- Added missing :meth:`pandas.Series.info` to API reference (:issue:`60926`)
- :class:`pandas.api.typing.NoDefault` is available for typing ``no_default``
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/_numba/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@


@functools.cache
def generate_apply_looper(func, nopython=True, nogil=True, parallel=False):
def generate_apply_looper(func, decorator: Callable):
if TYPE_CHECKING:
import numba
else:
numba = import_optional_dependency("numba")
nb_compat_func = jit_user_function(func)

@numba.jit(nopython=nopython, nogil=nogil, parallel=parallel)
@decorator
def nb_looper(values, axis, *args):
# Operate on the first row/col in order to get
# the output shape
Expand Down
Loading
Loading