Narwhals

Latest version: v1.30.0

Safety actively analyzes 714860 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 26

1.30.0

Changes

💥 Breaking changes

- fix!: align `Series.filter` param name with Polars (2164)

🚀 Performance improvements

- perf: simplify pandas scatter (2154)

✨ Enhancements

- feat: support passing multiple arguments positionally to get_native_namespace (2178)
- feat: Added `struct` namespace with `field` method. (2146)
- feat: add `rolling_sum` for sqlframe and pyspark (2168)
- feat: support `cum_sum` for lazy backends (2132)

🐞 Bug fixes

- fix: parse timezone-aware datetime strings as UTC consistently across backends (2166)
- fix!: align `Series.filter` param name with Polars (2164)
- fix(typing): Narrow `NativeSeries` Protocol (2159)

📖 Documentation

- docs(ruff): Improve config docs (2173)
- docs: even more concise docstrings (2068) (2163)

🛠️ Other improvements

- test: fixup cudf failures (2181)
- chore(typing): remove unused `pandas-stubs` ignores (2172)
- chore: remove unnecessary testing logic for pyspark (2170)
- refactor: adds `_Stores(Native|Compliant)` (2130)
- chore(typing): `SparkLikeExpr` properties (2152)
- ci: Add darts to downstream tests (2118)
- ci: fix plotly requirement files in downstream tests (2161)

Thank you to all our contributors for making this release possible!
FBruzzesi, MarcoGorelli, dangotbanned, osoucy, skritsotalakis and DeaMariaLeon

1.29.1

Changes

- feat: Spec'd-out `CompliantExpr` (2119)
- [pre-commit.ci] pre-commit autoupdate (2139)

✨ Enhancements

- feat: support reversed cumulative expressions in `over` for pandas-like (2141)
- feat: support anonymous expressions in `over` context for pandas-like, support `over` for multi-partitioned dask (2138)

🐞 Bug fixes

- fix: pyarrow scatter was returning incorrect results when indices were not sorted (2156)
- ci: fix doc build for `win32` (2147)
- fix: pass ddof down in std().over() for pandas-like (2143)

📖 Documentation

- docs: Add info in `nw.when` regarding chained statements (2151)
- ci: fix doc build for `win32` (2147)

📦 Build system

- ci: fix doc build for `win32` (2147)

🛠️ Other improvements

- docs: remove non-existent "args" (2153)
- ci: get cuDF test suite green again (2145)
- refactor: Use `chain.from_iterable` more (2140)
- refactor: allow callable in `CompliantExpr.from_column_names` to reuse for `CompliantNamespace.<all|col|exclude>` (2134)

Thank you to all our contributors for making this release possible!
FBruzzesi, MarcoGorelli, dangotbanned, pre-commit-ci[bot] and [pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci)

1.29.0

Changes

- test: enhance xfail markers with specific reasons in timestamp_test.py (2065)
- refactor: Generic `CompliantSelector` (2064)
- docs: more concise docstrings(2068) (2117)
- chore: deprecate `LazyFrame.gather_every` in main namespace (but maintain it in stable.v1) (2103)
- test(typing): fix `DataFrame.sort_values` overload match (2109)

🚀 Performance improvements

- perf: Avoid redefining `lambda` in `*Namespace.all` (2102)
- perf: avoid full broadcast for otherwise_value in when/then/otherwise (2098)
- perf: use cached property for schema/columns lazy frames (2093)
- perf: only validate duplicate column names when collecting for duckdb/pyspark/dask (2092)

✨ Enhancements

- feat: Adds `nw.exclude` (2122)
- feat: Add support for pandas-like `.diff().over(group)` (2128)
- fill_null with expression (2106)
- feat: Adds `DataFrame.iter_columns` (2104)
- feat: str.split (1932) (2054)
- feat(typing): Backport generic `Series` to `v1` (2110)
- feat: align `over` signature with Polars (2096)
- chore: Finalize support for SQLFrame (2038)

🐞 Bug fixes

- fix(typing): Include `Expr` in `fill_null` signature (2129)
- fix: Allow exprs in `.filter` constraints (2114)
- fix: `pyspark` unpivot with index `None` (2090)

📖 Documentation

- docs: Add API example docs for Field dtype (2131)
- docs: add `Implementation` page (2107)
- docs: concise_docstrings (2068) (2086)

🛠️ Other improvements

- refactor: Simplify `ArrowGroupBy.__iter__` (2133)
- chore: simplify pandas-like over (2127)
- chore(typing): Generic `CompliantDataFrame` (2115)
- chore(typing): enable typing checks for `pyspark` (2051)
- chore(typing): remove unused, ignored `TypeVar` (2108)
- chore(typing): fix `group_by` (2105)
- perf: Avoid redefining `lambda` in `*Namespace.all` (2102)
- chore: rename changes_length to filtration (2094)
- chore: add `has_open_windows` to `ExprMetadata` instead of `is_order_dependent` (2078)
- chore(typing): Resolve `_dask` errors (2087)
- refactor(typing): Use a forward ref for `IntoCompliantExpr` (2088)
- chore(typing): Fix `(Pandas|Arrow)(When|Then)` (2089)
- refactor(ruff): enable some preview rules (2042)

Thank you to all our contributors for making this release possible!
EdAbati, FBruzzesi, MarcoGorelli, dangotbanned, janpipek, luke396, skritsotalakis and thomasjpfan

1.28.0

Changes

🚀 Performance improvements

- perf: avoid repeating constant iteration (2079)
- chore(perf): move `combine_evaluate_output_names` check (2040)
- perf: Avoid double-parsing in concat_str (2039)

✨ Enhancements

- enh: Deprecate `native_namespace` in favour of `backend` in `read_csv` (2063)

🐞 Bug fixes

- chore: remove unused kwargs in `_pandas_like` and `_arrow` (2069)
- fix: disallow non-elementary operations in .over for pandas (2062)
- fix: Type conversion from Spark Struct to narwhals Struct. (2037)
- fix: Use metaclass for safe `DType` attr access (2025)

📖 Documentation

- docs: remove griffe fork to build docs (2080)
- chore: remove unused kwargs in `_pandas_like` and `_arrow` (2069)
- docs: Add standardized test failure patterns to CONTRIBUTING.md (2052)

🛠️ Other improvements

- chore(typing): Remove unused `pyright` ignores (2076)
- chore(typing): Re-enable `mypy` strict (2077)
- refactor: Use real class for `ExprMetadata` (2074)
- chore: use combine_metadata more (2073)
- chore: use default_metadata (2072)
- chore: use more expression metadata functions (2071)
- chore: use Expr._from_callable (2070)
- chore: remove unused kwargs in `_pandas_like` and `_arrow` (2069)
- chore: use `change_metadata_kind` (2067)
- chore(typing): add `CompliantSeries.dtype` (2066)
- refactor(typing): make `_evaluate_output_names` generic (2053)
- refactor(typing): Avoid more `ignore[attr-defined]` on `Datetime` (2049)
- chore: remove more `kwargs` from dask, dont treat `ddof` as expressifiable arg (2059)
- chore(typing): add `CompliantExpr._version` (2060)
- chore: remove `kwargs` from `selector` function (2058)
- refactor: deduplicate `*.selectors` (2057)
- ci(typing): add `pyright` to ci (2035)
- chore: refactor EVERYTHING to do with broadcasting (2005)
- ci: dont pass filenames to mypy in pre-commit (2046)
- chore: add colors in CI and run `marimo` only in selected python version (2043)
- chore(perf): move `combine_evaluate_output_names` check (2040)
- chore: refactor right-hand-side arithmetic to not use lit (2034)

Thank you to all our contributors for making this release possible!
EdAbati, FBruzzesi, MarcoGorelli, dangotbanned, luke396, osoucy and raisadz

1.27.1

Changes

🐞 Bug fixes

- fix: PySpark was raising during `collect` when it contained no rows and a void dtype column (2032)
- fix: `is_in` was raising when used with empty list (2031)

🛠️ Other improvements

- chore: fix pandas-stubs issues (2008)
- fix(typing): Resolve all `mypy` & `pyright` errors for `_arrow` (2007)

Thank you to all our contributors for making this release possible!
EdAbati, MarcoGorelli and dangotbanned

1.27.0

Changes

🚀 Performance improvements

- perf: Avoid evaluating expr twice in mean_horizontal (2028)
- perf: avoid try/except in _hasattr_static (2014)
- perf: fast path for pandas-like group by with single expression and avoid resetting index if not necessary (2010)

✨ Enhancements

- feat: support casting to and from spark-like structs (1991)
- feat: Add support for `series[other_series]` (2013)

🐞 Bug fixes

- fix: adjust duckdb population skewness by correction factor to get sample skewness (2021)
- fix: sqlframe false positives in compliance checks (2011)

🛠️ Other improvements

- chore(typing): Upgrade `TypeGuard` -> `TypeIs` (2027)
- refactor: remove `Array` shape default (2026)
- refactor: reuse `Schema.to_<backend>()` in `from_numpy` (2024)
- chore(typing): relax `from_numpy` to use `Mapping`, `Sequence` (2023)
- chore(typing): relax `from_dict` to use `Mapping` (2022)
- tests: Allow to run pytest narwhals --doctest-modules without ibis (2019)
- ci(typing): use `tool.mypy.pretty = true` (2018)
- fix: various typos (2016)
- ci: update pointblank deps to test downstream in ci (2015)
- chore(typing): resolve time unit/zone `set` invariance (2012)
- test: add test for `sum_horizontal` with column transformation (2009)
- chore: simplify when implementation (2003)
- ci: remove `pyspark` from Windows CI (1998)
- chore(typing): add overloads to `isinstance_or_issubclass` (1997)
- chore: parse series and ndarrays as expressions (1994)
- chore(typing): remove unused ignores (1979)
- fix: use `mypy` pre-commit in local environment (1966)
- chore: clean up flatten and extract (1995)
- chore: determine whether to use compliant_frame.aggregate at narwhals level (1993)
- chore: Refactor filter (1992)
- chore: alias named expressions at narwhals level (1990)
- chore: Expr metadata refactor (1986)
- chore: use toArrow in PySpark 4.0+ (1987)
- tests: skip cudf hist tests (1988)

Thank you to all our contributors for making this release possible!
DeaMariaLeon, EdAbati, FBruzzesi, MarcoGorelli, anopsy, camriddell, dangotbanned and raisadz

Page 1 of 26

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.