Write Polars syntax, run it on Pandas and DuckDB
Comments
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Summary
Khuyen Tran at OpenTeams shows how Narwhals (v2.28) lets one function written in Polars syntax run on pandas, Polars, lazy Polars, DuckDB and, through a community plugin, DataFusion. Order-dependent operations on lazy inputs raise an error unless order_by is set, and a parametrized pytest exposed a pandas float-versus-integer mismatch. She also says Narwhals keeps Polars 1.x explode behavior on Polars 2.1, and that narwhals.stable.v2 is a stable API. Several of these claims come from the author alone, without cited sources.