pypi narwhals 2.30.0
Narwhals v2.30.0

2 hours ago

Highlights

  • Plugins can customise how their native objects are shown in a Narwhals repr (#4184).
  • New {Expr,Series}.bin_intervals (#4238).
  • Thread safety for DuckDB and narwhals.sql, now covered by a free-threading test suite (#3807).
  • Faster import narwhals (#4181).
  • pip install narwhals[dask] now installs the narwhals-dask plugin as well (#4179).
  • Introducing pizzlies, a pure-Python eager dataframe library built on dicts of lists, with the Narwhals API. It can be used on its own or as a Narwhals plugin (#4177). It will be released on PyPI separately.

Changes

🚀 Performance improvements

  • perf: optimise import times (#4181)

✨ Enhancements

  • feat: add support for {Expr,Series}.bin_intervals (#4238)
  • feat: export EagerAllowed and IntoBackend in stable.{v1,v2}.typing (#4155)
  • feat: support str.replace with n=1 for DuckDB (#4107)
  • feat: let plugins customise the repr of their native objects (#4184)
  • DEP: add narwhals-dask to dask extra set of dependencies (#4179)

🐞 Bug fixes

  • fix: use native xor for Ibis integer columns (#4187)
  • fix: return typed empty columns from Series.hist with no bins (#4214)
  • fix: return True from Series.is_sorted on PyArrow for a series of less than two values (#4242)
  • fix: preserve PyArrow list types when sorting (#4222)
  • fix: quote DuckDB Enum categories as SQL strings, and reject Enum categories pizzlies can't represent (#4250)
  • fix: read pandas time zones such as America/New_York as Datetime and truncate tz-aware columns on the local clock (#4247)
  • fix: thread-safety for DuckDB and narwhals.sql, with a free-threading test suite (#3807)
  • fix: unify errors when a lazy selector matches zero columns (#4237)
  • fix: run DuckDB top_k, unpivot and join_asof on the frame's own connection (#4235)
  • fix: group_by().agg() with a selector matching only keys (#4231)
  • fix: return correct cum_max/cum_min for float columns on PyArrow<26 (#4173)
  • fix: return integer count from Series.hist on empty or all-null data (#4047)
  • fix: raise DuplicateError from with_row_index when the name is taken (#4197)
  • fix: keep every row in drop_nulls with an empty subset (#4196)
  • fix: str.tail(0) now returns empty strings instead of the full string (#4120)
  • fix: return null instead of NaN from mean_horizontal for all-null rows across backends (#4160)

🐻‍❄️ pizzlies

  • feat: add pizzlies, a pure-Python dataframe plugin on dicts of lists (#4177)
  • feat(pizzlies): add a pure-Python Parquet reader (#4204)
  • feat(pizzlies): lazy frames with projection pushdown (#4217)
  • fix(pizzlies): match Polars on select and group_by edge cases (#4228)
  • fix(pizzlies): stricter IO argument checks (#4227)
  • fix(pizzlies): Pizzlies polars parity (#4218)
  • fix(pizzlies): rank NaN above other values in single-key top_k (#4198)
  • fix(pizzlies): use Kleene logic when the left operand of &/| is all-null (#4200)

📖 Documentation

  • docs: show how to read a chDB DataStore through Arrow (#4236)
  • docs: fix CONTRIBUTING.md spacing (#4201)

🛠️ Other improvements

  • ci(perf): Avoid tracking coverage for pointblank (#4249)
  • ci: skip tubular benchmark tests in the downstream job (#4248)
  • fix(ci): install fairlearn test deps from its tests dependency group (#4239)
  • ci: Remove pyrefly pin from shiny (#4221)
  • ci: fix pandas-nightly kleene test and shiny pyrefly, remove obsolete downstream pins (#4213)
  • ci: fix tubular dependencies installation (#4185)
  • ci: smoke test narwhals-dask against its minimum Narwhals version (#4175)
  • release: Bump narwhals-dask version to 0.1.0 (#4176)
  • chore: prek autoupdate (#4203, #4174)
  • chore(deps): lock file maintenance (#4253, #4215, #4193, #4190, #4186, #4183, #4178)

Thank you to all our contributors for making this release possible!
@555aaditya, @emreocell, @FBruzzesi, @KshitijKasodkar, @MarcoGorelli, @mhhhnr, @Mike-Animal-Counseling, @neutrinoceros, @parthdembla007, @RavSinghChandan, @T-Berger, @github-actions[bot] and @renovate[bot]

Don't miss a new narwhals release

NewReleases is sending notifications on new releases.