Skip to content

Releases: narwhals-dev/narwhals

Narwhals v1.37.1

29 Apr 13:59
Compare
Choose a tag to compare

Changes

  • test: Simplify test_lazy_backend (#2445)

🐞 Bug fixes

  • fix: fix nw.Series repr for Polars (#2453)
  • fix: Ensure Polars wrapped in Narwhals can be passed to Joblib (#2451)

🛠️ Other improvements

  • chore: Parsing functions -> enum constructors (#2442)
  • chore(typing): Rename, unleak _arrow.typing aliases (#2448)
  • chore(typing): fix is_sized_multi_index_selector (#2449)

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

Narwhals v1.37.0

28 Apr 11:39
Compare
Choose a tag to compare

Changes

🚀 Performance improvements

  • perf: Add pa.Table rename fastpath for >=17 (#2433)

✨ Enhancements

  • enh: Support fill_null(strategy=...).over(order_by=...) for pandas-like (#2443)
  • feat: Add support for spark connect (#2417)
  • feat: Allow non-null strategy in fill_null for DuckDB and SparkLike (#2413)
  • feat: Allow expressions as group_by keys (#2325)

🐞 Bug fixes

  • patch: Avoid pyspark no partition for window ops warning (#2429)

📖 Documentation

  • docs: Remove inheritable docstrings (#2427)

🛠️ Other improvements

  • chore(typing): Simplify some __getitem__ annotations (#2436)
  • chore: Use less confusing dask imports (#2437)
  • chore(typing): fix/ignore utils, tpch warnings (#2426)
  • perf: Add pa.Table rename fastpath for >=17 (#2433)
  • chore: Add Version.dtypes, remove import_dtypes_module (#2431)
  • chore: Add Version.namespace, remove import_namespace (#2425)
  • chore: remove setuptool<78 in CI (#2441)
  • tests: un-xfail polars group by expr streaming (#2440)
  • ci: fix pointblank downstream test (#2428)

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

Narwhals v1.36.0

23 Apr 07:15
Compare
Choose a tag to compare

Changes

🚀 Performance improvements

  • perf: Delay converting categories to tuple for Enum (#2414)
  • perf: cache columns property for lazyframe's (#2407)

✨ Enhancements

  • feat: Improve DataFrame.__getitem__ consistency (#2393)
  • feat: Support for additional rank methods in spark-like (#2409)
  • feat: Add support for DuckDB Enum (#2401)
  • feat: Adds private Namespace class (#2324)
  • feat: let nw.Enum accept categories, map pandas ordered categorical to Enum (only in main namespace, not stable.v1) (#2192)
  • feat(typing): Add polars python type aliases (#2362)

🐞 Bug fixes

  • fix: Use np.generic in is_numpy_scalar (#2395)
  • fix(typing): Narrow TypeVar(s) used in (Data|Lazy)Frame (#2356)

📖 Documentation

  • docs: add docstrings examples for Int128 and UInt128 (#2396)
  • docs: Update installation guide to reflect use of dependency-groups (#2392)

🛠️ Other improvements

  • test: fixup test suite for cudf (#2418)
  • test: update tests so cudf is green (#2411)
  • perf: cache columns property for lazyframe's (#2407)
  • chore: DuckDB dtype parsing using .id and .children properties (#2406)
  • feat: Adds private Namespace class (#2324)
  • chore(typing): Remove all self: Self annotations (#2399)
  • chore: use pytest.skip for dt tests which can never pass (#2398)
  • chore(typing): Remove type from is_list_of return (#2397)
  • chore: @requires for backend method constraints (#2371)
  • chore: use __getitem__ less internally (#2390)
  • refactor: Simplify (Arrow|PandasLike)Namespace.concat (#2381)

Thank you to all our contributors for making this release possible!
@FBruzzesi, @MarcoGorelli, @camriddell, @dangotbanned and @mollydesjardin

Narwhals v1.35.0

14 Apr 17:16
Compare
Choose a tag to compare

Changes

💥 Breaking changes

  • Fix: Align Series.hist with new Polars behaviour (#2374)
  • feat!: disallow concat(..., how="horizontal") for LazyFrame (#2341)

🚀 Performance improvements

  • perf: Only use first element to sniff types in sequences in __getitem__ and filter (#2384)

✨ Enhancements

  • feat: Remove "unstable" marking from rolling_* and ewm_mean (#2378)
  • feat: Add support for 'ordinal', 'max', 'average' in DuckDBExpr.rank (#2319)
  • feat!: disallow concat(..., how="horizontal") for LazyFrame (#2341)
  • feat: unify exception for nested over statements, nested aggregations, filtrations on aggregations, document expression metadata better (#2351)
  • feat(typing): Add polars literal aliases (#2352)

🐞 Bug fixes

  • fix: DuckDBLazyFrame.rename using python API (#2382)
  • Fix: Align Series.hist with new Polars behaviour (#2374)
  • fix: nw.len().over was unnecessarily raising for pandas-like (#2372)

📖 Documentation

  • feat: unify exception for nested over statements, nested aggregations, filtrations on aggregations, document expression metadata better (#2351)
  • feat(typing): Add polars literal aliases (#2352)

🛠️ Other improvements

  • test: xfail cudf where necessary (#2386)
  • chore: use nw_v1 / nw naming consistently in tests (#2379)
  • refactor: Simplify PandasLikeNamespace.concat (#2368)
  • chore!: use Python API more for DuckDB support (#2370)
  • test: use skip tests on old versions instead of xfailing, print slowest tests (#2375)
  • chore: prepare tests for v2 (#2380)
  • ci: Run PySpark selectively (#2366)

Thank you to all our contributors for making this release possible!
@FBruzzesi, @MarcoGorelli, @camriddell, @dangotbanned and @marvinl803

Narwhals v1.34.1

09 Apr 09:04
Compare
Choose a tag to compare

Changes

  • [pre-commit.ci] pre-commit autoupdate (#2357)

🐞 Bug fixes

  • fix: Check typing_extensions.TypeVar(default) exists (#2361)

🛠️ Other improvements

  • chore(typing): Preserve containers in cast_for_truediv (#2355)

Thank you to all our contributors for making this release possible!
@FBruzzesi, @dangotbanned, @mnxoid, @pre-commit-ci[bot] and pre-commit-ci[bot]

Narwhals v1.34.0

07 Apr 11:02
Compare
Choose a tag to compare

Changes

  • test: unify tests in group_by_test.py (#2195)

🚀 Performance improvements

  • chore(typing): Fix [assignment] with extract_args_kwargs (#2329)

✨ Enhancements

  • enh: support unique(keep='none') for pyspark/sqlframe (#2338)

🐞 Bug fixes

  • fix(typing): Narrow TypeVar used in Series (#2347)
  • test(typing): Narrow Constructor, ConstructorEager aliases (#2349)
  • refactor(typing): Simplify concat signature (#2339)
  • fix: unpivot was unnecessary failing for PySpark/SQLFrame when neither on nor index were passed (#2335)
  • chore(typing): Fix [assignment] with extract_args_kwargs (#2329)
  • chore(typing): Fix DTypes typing (#2330)

📖 Documentation

  • docs: Use separate_signature: true (#2353)
  • feat(internal): Add docstring template (#2333)
  • chore: Use _compliant.typing aliases in more places (#2336)

🛠️ Other improvements

  • chore: bump pyarrow-stubs==19.1 (#2350)
  • chore: use less sql for duckdb, do extra validation (#2331)
  • feat(internal): Add docstring template (#2333)
  • chore: Use _compliant.typing aliases in more places (#2336)
  • test: use constructor_eager for testing gather_every (#2334)
  • chore: Add Compliant*.from_native (#2315)
  • chore: Transition selectors away from Protocol38 (#2326)
  • chore: Make Polars(Expr|Series) compliant (#2328)
  • test: fix wrong reason in group_by_test.py (#2332)
  • chore: simplify PandasLikeDataFrame.with_columns (#2327)

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

Narwhals v1.33.0

31 Mar 17:13
Compare
Choose a tag to compare

Changes

🚀 Performance improvements

  • perf: Avoid unnecessary calls in Expr.clip method (#2303)

✨ Enhancements

  • fix: change rank ExprKind to transform (#2316)
  • feat: add rank for Lazy backends (#2310)
  • feat: disallow .over(order_by=...) for non-order-dependent operations (as it signals a user error) (#2314)
  • feat: add rolling_var and rolling_std for lazy backends (#2299)
  • feat: Allow spark-like backends in scan_csv function (#2300)
  • feat: Add DuckDBExpr.is_unique() method (#2301)
  • feat: add rolling mean for lazy backends (#2297)
  • feat(sqlframe): Allow options in scan_parquet function (#2295)
  • feat: Add DataFrame.clone for pyarrow (#2288)
  • feat: add cum_count and cum_prod to PySpark and DuckDB (#2286)
  • feat: Add cum max and cum_min for DuckDB (#2278)

🐞 Bug fixes

  • fix: Expr.mode broadcasting (#2280)
  • ci: Remove sqlframe pin from --group typing (#2298)
  • fix: use specialised duckdb functions for std_pop/std_samp/var_pop/var_samp (#2289)
  • fix: fixup polars join version check throwing unnecessary deprecation warning for outer join (#2287)

📖 Documentation

  • docs: Expand contributing guidelines (#2309)

🛠️ Other improvements

  • test: add test for shift->cum_sum (#2317)
  • ci: fixup cudf test failures, support rolling_std/rolling_var/rolling_mean for pandas in grouped context (#2322)
  • chore: Make duckdb quack more like polars (#2321)
  • chore: use Python API more in DuckDB (#2318)
  • refactor: Add CompliantDataFrame.from_arrow (#2306)
  • chore(typing): Resolve _polars.utils dtype ignores (#2312)
  • chore: Tidy up PolarsExpr (#2313)
  • refactor: Add LazyExprNameNamespace (#2311)
  • refactor: Add CompliantDataFrame.from_dict (#2304)
  • refactor: Use ._with_* for internal API methods (#2305)
  • chore: Add EagerSeries*Namespace protocols (#2294)
  • refactor: Use .from_iterable() in new_series (#2302)
  • refactor: *(Namespace|DataFrame).from_numpy (#2283)
  • chore: Update ._native_series refs (#2293)
  • test: ensure expected data has every column of theresult data (#2296)
  • ci: fixup for duckdb pre 1.3 (#2292)
  • chore: Update ._native_frame refs (#2290)
  • chore: always set CompliantExpr._metadata (#2282)

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

Narwhals v1.32.0

24 Mar 12:40
Compare
Choose a tag to compare

Changes

💥 Breaking changes

  • feat!: remove maintain_order from LazyFrame.unique, as it was never supported (#2247)

✨ Enhancements

  • feat: add cum_min to PySpark (#2267)
  • feat: make order_by in Expr.over public (#2271)
  • feat: Add support for full join (#2126)
  • enh: Support diff, shift, is_first_distinct, is_last_distinct for PySpark, SQLFrame, and DuckDB (#2270)
  • feat: add cum_max for PySpark (#2265)
  • feat: support window operations for DuckDB (#2263)
  • feat: track whether expressions are multi-output, unify error messages (#2246)
  • feat: Enable spark-like backends in scan_parquet (#2235)
  • feat: Binary dtype support (#2243)
  • feat!: remove maintain_order from LazyFrame.unique, as it was never supported (#2247)

🐞 Bug fixes

  • fix: safety assertion was being thrown for Expr.is_last_distinct with over and _order_by by pandas and pyarrow (#2269)
  • chore(typing): add missing _FullContext to CompliantDataFrame (#2251)

📖 Documentation

  • feat: make order_by in Expr.over public (#2271)
  • doc: fix docs CI (#2259)
  • docs: fix docs CI dependencies (#2260)

🛠️ Other improvements

  • ci: skip test_join_duplicate_column_names on old polars (#2277)
  • ci: Get CI green for cuDF tests (#2276)
  • chore: Clean up _arrow (#2275)
  • chore(typing): Move DepthTracking* typing (#2272)
  • chore: Track ExpansionKind in ExprMetadata (#2266)
  • feat: Adds Compliant(When|Then) (#2261)
  • chore: Add CompliantExpr._with_metadata (#2262)
  • feat: Adds CompliantGroupBy (#2252)
  • ci: skip Polars nightly if notebook is still running (#2257)
  • chore: Spec CompliantSeries (#2236)
  • chore: downstream CI cleanup (validoopsie and pointblank) and re-order dependency groups (#2255)
  • chore: Add CompliantDataFrame.native (#2249)
  • chore: Spec CompliantLazyFrame (#2232)
  • test: Scope dataframe library imports to fixtures in conftest.py (#2241)
  • chore: use is_scalar_like in apply_n_ary_operation (#2242)
  • chore: move dev dependencies to dependency-groups (#2238)
  • test: Fix yet more tests to work without polars (pandas, pyarrow) (#2250)
  • test: Fix more tests to work without polars (and pandas, pyarrow) (#2245)
  • Fix noxfile.py syntax for nox-2025.2.9 (#2240)

Thank you to all our contributors for making this release possible!
@EdAbati, @FBruzzesi, @MarcoGorelli, @dangotbanned, @marvinl803, @mgorny, @raisadz and @tylerriccio33

Narwhals v1.31.0

17 Mar 15:27
Compare
Choose a tag to compare

Changes

💥 Breaking changes

  • feat!: require at least one expression be passed to lazyframe select and lazyframe.with_columns, remove lazyframe.clone (#2206)

⚠️ Deprecations

  • docs: replace remaining native_namespace refs (#2221)
  • chore: Deprecate native_namespace in favour of backend in from_arrow (#2219)
  • chore: Deprecate native_namespace in favour of backend in scan_csv (#2218)
  • chore: Deprecate native_namespace in favour of backend in scan_parquet (#2217)
  • chore: Deprecate native_namespace in favour of backend in read_parquet (#2216)
  • chore: Deprecate native_namespace in favour of backend in from_numpy (#2215)
  • chore: Deprecate native_namespace in favour of backend in new_series (#2212)

✨ Enhancements

  • feat: Raise uniform error when passing Series of different lengths to with_columns (#2224)
  • enh: Adds support for Time datatype (#2113)
  • Implement fill_null for spark-like (#2220)
  • feat!: remove require at least one expression be passed to lazyframe select and lazyframe.with_columns, remove lazyframe.clone (#2206)

🐞 Bug fixes

  • patch: xfail cast_test.py::test_cast_time for cudf (#2231)
  • fix(typing): Match lazy @overload in nw.from_native(...) (#2211)
  • fix: don't downcast large_string to string unnecessarily in concat_str for PyArrow (#2176)
  • refactor: adds _compliant sub-package (#2149)

📖 Documentation

  • docs: replace remaining native_namespace refs (#2221)
  • docs: add metalearners to used by/ecosystem (#2208)
  • docs: add Bokeh to "used by" (#2198)

🛠️ Other improvements

  • test: unify tests in dtypes_tests.py (#2144)
  • chore(typing): Resolve sqlframe>=3.24.0 errors (#2187)
  • chore: pin typing dependnecies (#2233)
  • test: Run TPCH with SQLFrame (#2228)
  • chore: Spec CompliantDataFrame (#2223)
  • refactor: Add CompliantSeries.from_numpy (#2196)
  • chore(typing): Fill out CompliantNamespace protocol (#2202)
  • chore: minor duckdb cleanup (#2204)
  • test: track and enforce sqlframe test coverage (#2200)
  • chore(ruff): add format to builtins-ignorelist (#2199)
  • chore(typing): Use SQLFrame instead of PySpark for _spark_like internally (#2190)
  • refactor: adds _compliant sub-package (#2149)
  • ci: unxfail sqlframe (#2186)
  • ci: update bump_version.py so it correctly pushes to stable branch (#2183)

Thank you to all our contributors for making this release possible!
@DeaMariaLeon, @FBruzzesi, @MarcoGorelli, @dangotbanned, @lucas-nelson-uiuc, @luke396 and @marvinl803

Narwhals v1.30.0

10 Mar 09:53
Compare
Choose a tag to compare

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