Apache DataFusion backend for Narwhals, via the Narwhals plugin system
Project Links
Meta
Requires Python: >=3.10
Classifiers
Development Status
- 4 - Beta
Programming Language
- Python :: 3
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
narwhals-datafusion
Apache DataFusion backend for
Narwhals, registered through the
narwhals.plugins entry point.
pip install narwhals-datafusion # core
pip install "narwhals-datafusion[extra-functions]" # + mode, skew, kurtosis
Usage
import narwhals as nw
import pyarrow as pa
from datafusion import SessionContext
ctx = SessionContext()
df = ctx.from_arrow(pa.table({"a": [1, 2, 3], "b": ["x", "y", "x"]}))
lf = nw.from_native(df) # nw.LazyFrame on this backend
result = (
lf.group_by("b")
.agg(nw.col("a").sum())
.sort("b")
.collect(backend="pyarrow")
)
Everything is lazy until .collect(): expressions become datafusion.Expr,
frame verbs become datafusion.DataFrame methods, and DataFusion executes the
plan. Dtypes are pyarrow end-to-end.
- Playground: a tour of the API, extra included
- API coverage: supported, partial and unsupported methods
- Known limitations
- Architecture
Used by
- pandera:
pip install 'pandera[datafusion]'validatesdatafusion.DataFramethrough this plugin.tests/pandera/pins thenarwhals.stable.v1calls it makes.
Compatibility
- Python
>=3.10; tested on 3.12. datafusion>=55,<56: capped at the tested major; a release moves the cap.narwhals>=2.27: floor only; tested on 2.28, thenarwhals/submodule.datafusion-extra-functions>=0.5.5(extra): each release pins its datafusion major.- Weekly,
compat.yml(the badge): both suites on the newest narwhals release inside the datafusion cap, extra included.
0.2.0
Nov 07, 2026
0.1.6
Oct 16, 2026
0.1.5
Sep 09, 2026
0.1.4
Sep 09, 2026
0.1.3
Sep 05, 2026
0.1.2
Sep 05, 2026
0.1.1
Sep 04, 2026
0.1.0
Sep 02, 2026