Sign in

marcogorelli.bsky.social

@marcogorelli.bsky.social
242 followers 202 following 89 posts

Senior Software Engineer at Quansight Labs Pretty focused on Narwhals and Polars these days, generally interested in dataframes and time series

PostsRepliesMedia
marcogorelli.bsky.social @marcogorelli.bsky.social · 16/09/2026
✨ The Pyrefly type-checker now tracks Polars DataFrame schema 🏷️ Declare a schema using Annotated 📚 Enjoy clearer self-documenting code and avoid some schema-related issues before hitting prod 😇 The annotated schema will be ignored by other type-checkers so you won't get conflicts between them
Example of using `Annotated` to declare Polars DataFrame schemaExample of Pyrefly schema diagnostics
031
marcogorelli.bsky.social @marcogorelli.bsky.social · 09/04/2026
✨ New Narwhals expression: `nw.corr` 👥 Supported in both group-by and window contexts 🌐 Polars, DuckDB, PyArrow, PySpark, pandas...all supported 🗒️ PS. please don't draw conclusions about ice cream sales and drownings from this post
Demo of narwhals.corr
261
marcogorelli.bsky.social @marcogorelli.bsky.social · 10/03/2026
Bwlch Llanberis (Welsh folk tune) Named after a scenic road in Snowdonia, this is one of my favourite Welsh melodies
010
marcogorelli.bsky.social @marcogorelli.bsky.social · 22/02/2026
😅yup thanks!
000
marcogorelli.bsky.social @marcogorelli.bsky.social · 22/02/2026
Tafliad Carreg (Welsh folk tune) This one was written by Mike Lease, and it means "A stone's throw" Here's my attempt at it. First time tuning my guitar to DADGAD, and my initial impression is that standard tuning might be a mistake
110
marcogorelli.bsky.social @marcogorelli.bsky.social · 13/02/2026
✨ @marimo.io now supports Pyrefly as an LSP, helping you to catch errors before you even execute your code! ⚙️ To enable it: - Install pyrefly - Settings -> User settings -> Enable pyrefly 🤸 This was a fun one to contribute to (🙏 Note that the ty type checker is also supported)
Demo of Pyrefly LSP in Marimo notebook
010
marcogorelli.bsky.social @marcogorelli.bsky.social · 30/01/2026
✨ New @pola.rs feature: if you misspell a time zone, it will suggest the correct one to you 🤸‍♂️This was a fun one to work on, Levenshtein and all!
Demo of Polars suggesting the correct time zone
020
marcogorelli.bsky.social @marcogorelli.bsky.social · 04/01/2026
✨ New Polars features: `min_by` and `max_by` 💡 Get the first (or last) value of a column ordered by another expression 🌊🦄 Narwhals will have this feature too, making it available to @arrow.apache.org , pandas, @duckdb.org , and more
Demo of pandas `min_by`Demo of Narwhals min_by
061
marcogorelli.bsky.social @marcogorelli.bsky.social · 04/12/2025
😱🙀 The pandas 3.0 release-candidate is here! 💥 Will it break your code? 💡 Test it with `uv pip install -U --pre pandas` to find out! 🌊🦄 Narwhals users can relax, everything's taken care of for you, no need to do anything ☺️
pandas 3.0 rc demo
032
marcogorelli.bsky.social @marcogorelli.bsky.social · 19/11/2025
and now we're going full-circle 😜 labs.quansight.org/blog/pandas_...
labs.quansight.org
Expressions are coming to pandas!
`pd.col` will soon be a real thing!
120
marcogorelli.bsky.social @marcogorelli.bsky.social · 13/11/2025
✨ The next @pola.rs release will support lazy pivot! 💡 All you need is to specify the unique values to pivot on
Demo of Polars lazy pivot
010
marcogorelli.bsky.social @marcogorelli.bsky.social · 10/11/2025
narwhals-daft: github.com/narwhals-dev...
github.com
GitHub - narwhals-dev/narwhals-daft: Narwhals plugin for Daft
Narwhals plugin for Daft. Contribute to narwhals-dev/narwhals-daft development by creating an account on GitHub.
000
marcogorelli.bsky.social @marcogorelli.bsky.social · 10/11/2025
✨ Narwhals now supports Daft! 🔌Just install the `narwhals-daft` plugin, and then `narwhals.from_native` will accept Daft DataFrame! 💡 No extra dependencies requires, computation will remain native (and distributed, and lazy!) until you call `collect`
Demo of Narwhals-daft
150
marcogorelli.bsky.social @marcogorelli.bsky.social · 04/11/2025
😲 Wes McKinney mentioned Narwhals on a podcast
Screenshot of Wes mentioning Narwhals on a podcast
020
marcogorelli.bsky.social @marcogorelli.bsky.social · 23/10/2025
✨ New @pola.rs feature: `list.agg` 💡 Compute any Expr aggregation on a list column, just use `pl.element()` 🔜 Coming soon, in version 1.35!
Demo of `list.agg` in Polars 1.35
060
marcogorelli.bsky.social @marcogorelli.bsky.social · 20/10/2025
The first year of free-threaded Python labs.quansight.org/blog/free-th...
labs.quansight.org
The first year of free-threaded Python
A recap of the first year of work on enabling support for the free-threaded build of CPython in community packages.
000
marcogorelli.bsky.social @marcogorelli.bsky.social · 20/10/2025
🥧🧵 Narwhals now tests against Python 3.14 (pi-Python!) free-threading build 👉 For more on free-threaded Python, my colleague Nathan's blog post is an excellent read, link in comments
Demo of Narwhals running with free-threaded Python
100
marcogorelli.bsky.social @marcogorelli.bsky.social · 16/10/2025
✨ Narwhals now supports `format` across all backends 🧵 Create new string columns using placeholders and expressions 🌊🦄 Yet another piece of the @pola.rs API brought to pandas, @duckdb.org , PySpark, PyArrow, and more!
Demo of narwhals.format
031
marcogorelli.bsky.social @marcogorelli.bsky.social · 13/10/2025
pyrefly.org/blog/numpy-t...
pyrefly.org
Bringing NumPy's type-completeness score to nearly 90% | Pyrefly
We tell the story of how we brought NumPy's type-completeness score from ~33% to nearly 90%
010
marcogorelli.bsky.social @marcogorelli.bsky.social · 13/10/2025
✨ NumPy's MaskedArray class is now type-complete 🏷️ Enjoy improved code completion and typing! 🙏 Thank you to Quansight Labs and Meta for having facilicated and funded the work (blog post in comments)
Before vs after of using MaskedArray methods in NumPy
140
marcogorelli.bsky.social @marcogorelli.bsky.social · 03/10/2025
🌝 The next @astropy.org release will support generic dataframe tables (like @pola.rs ) 🌊🦄 Powered by Narwhals
PR of Astropy using Narwhals
010
marcogorelli.bsky.social @marcogorelli.bsky.social · 18/09/2025
oh no!!! 😭
000
marcogorelli.bsky.social @marcogorelli.bsky.social · 12/09/2025
💡 Life-pro-tip: enable inline type hints 🏷️ Your editor will display inferred types for variables you haven't annotated 🕵️ Debugging those red squiggly lines will become much easier
Demo of inlay hints with NarwhalsEnabling inlay hints in vscode
151
marcogorelli.bsky.social @marcogorelli.bsky.social · 23/08/2025
polars Series implement __array__, I'd have thought that a lot of the time you can pass Series as then they'll be converted by any `np.asarray` call. at least passing Polars Series to matplotlib works like that
120
marcogorelli.bsky.social @marcogorelli.bsky.social · 23/08/2025
which stats packages are tied to pandas?
100
marcogorelli.bsky.social @marcogorelli.bsky.social · 22/08/2025
✨🐼 Pandas 3.0 will have `pd.col` syntax 💡 You can use it for clean chaining in `assign` and `loc` 🚀 It's happening, the PR just got merged!
Demo of pd.col
041
marcogorelli.bsky.social @marcogorelli.bsky.social · 12/08/2025
✨ New @pola.rs feature - you can now chain `name` expressions! 🌊🦄 As of Narwhals 2.0 (yes, we've released 2.0 🚀), this feature is available there as well! Little example below with our friend @duckdb.org
Example of `.name` chaining with PolarsExample of `.name` chaining with Narwhals
030
marcogorelli.bsky.social @marcogorelli.bsky.social · 07/08/2025
💡 "There's nothing for permanent than a temporary fix" Case in point, this pandas comment which was added [checks git log] ... 12 years ago 🙈
temporary solution added to pandas 12 years ago
020
Reposted by @marcogorelli.bsky.social
Michael E. Mann @michaelemann.bsky.social · 07/08/2025
"If the U.S. can't get its greenhouse emissions under control, they need to face real consequences" said the rest of the world.
22483149
marcogorelli.bsky.social @marcogorelli.bsky.social · 29/07/2025
💡 Today in open source: a 17-year-old NumPy commit promising that a new feature will be coming soon Any day now..
Screenshot of 17-year-old commit message in NumPy
000
marcogorelli.bsky.social @marcogorelli.bsky.social · 26/07/2025
😍 @posit.co have done it again 🧙 gt-extras offers even more functionality for their table renditions of @pola.rs and pandas dataframes! 🌊🦄 Using Narwhals for some dataframe logic
gt-extras demo
091
marcogorelli.bsky.social @marcogorelli.bsky.social · 20/07/2025
solarized light
010
marcogorelli.bsky.social @marcogorelli.bsky.social · 18/07/2025
💡 Solution: use Narwhals for universal dataframe support 🌊🦄
Meme of panicked Astronomer CEO caught on cam with the head of HR, with "When you find a new data science library" and "When you realise it only supports pandas" text overlaid
040
marcogorelli.bsky.social @marcogorelli.bsky.social · 15/07/2025
✨ New Formulaic release (1.2), featuring native support for @pola.rs ! 🌊🦄 Powered by Narwhals
Demo of Formulaic with native Polars support
1102
marcogorelli.bsky.social @marcogorelli.bsky.social · 09/07/2025
🎢 When the Q&A goes off-script 🤣 🇯🇵 Japanese math rock, 🅿️ porpoises and unfortunate aliases, and 🎤 Taylor Swift: 🥈All of these unexpectedly came up in this fun session, which is currently the 2nd most viewed of the conference 🙏 Thanks @pydatalondon.bsky.social for inviting me!
youtu.be
Marco Gorelli - How Narwhals brings Polars, DuckDB, PyArrow, & pandas together | PyData London 25
YouTube video by PyData
082
marcogorelli.bsky.social @marcogorelli.bsky.social · 01/07/2025
github.com/mlflow/mlflo...
github.com
Adopt Narwhals to support multiple eager dataframe · Issue #16518 · mlflow/mlflow
Description Follow up from #10292 (comment) What's Narwhals? Narwhals is a lightweight compatibility layer between dataframe libraries, with negligible overhead. Its API is a subset of the polars o...
020
marcogorelli.bsky.social @marcogorelli.bsky.social · 01/07/2025
🥳 The next version of @mlflow.org will support @pola.rs ! 😩 Slightly disappointingly, they do so by converting to pandas 🌊🦄 Could Narwhals help make MLFlow gain native support for Polars? Link to the discussion below 👇
MLFlow maintainer announcing that they merged the Polars dataset PR
130
marcogorelli.bsky.social @marcogorelli.bsky.social · 21/06/2025
sure - how do you know
210
marcogorelli.bsky.social @marcogorelli.bsky.social · 19/06/2025
🙀 It's scary to merge a 2,000+ line PR! 😇 But, this one was so thorough that we just had to ship it 🏆 Thanks to an incredible effort by Ryan Whitten, Narwhals supports Ibis! 💡You can now use Narwhals with all of Ibis' backends, plus some extra, whilst keeping @pola.rs expressive API!
PR which added Ibis support to NarwhalsDemo of Ibis via Narwhals
030
marcogorelli.bsky.social @marcogorelli.bsky.social · 06/06/2025
github.com/pola-rs/pola...
github.com
Release Python Polars 1.30.0 · pola-rs/polars
🚀 Performance improvements Switch eligible casts to non-strict in optimizer (#22850) Allow predicate passing set_sorted (#22797) Increase default cross-file parallelism limit for new-streaming mul...
000
marcogorelli.bsky.social @marcogorelli.bsky.social · 06/06/2025
✨ @pola.rs now supports `list.filter` 🪄 The `list` namespace is now even more turbocharged ⚡ 👇 Full release notes for 1.30
Demo of `list.filter` in Polars
160
marcogorelli.bsky.social @marcogorelli.bsky.social · 26/05/2025
sometimes that's all you need 😀
110
marcogorelli.bsky.social @marcogorelli.bsky.social · 26/05/2025
✨ PySpark 4.0 is out 🌊🦄 And it's already supported by Narwhals, including PySpark connect (thanks Francesco Bruzzesi!)
Example of using PySpark via Narwhals
011
marcogorelli.bsky.social @marcogorelli.bsky.social · 26/05/2025
Looks like a good decision, given she committed fraud
000
marcogorelli.bsky.social @marcogorelli.bsky.social · 22/05/2025
👉🌟 Narwhals: github.com/narwhals-dev... 📚 Narwhals and SQL: narwhals-dev.github.io/narwhals/gen...
github.com
GitHub - narwhals-dev/narwhals: Lightweight and extensible compatibility layer between dataframe libraries!
Lightweight and extensible compatibility layer between dataframe libraries! - narwhals-dev/narwhals
000
marcogorelli.bsky.social @marcogorelli.bsky.social · 22/05/2025
✨ Narwhals now supports `fill_null` with forwards and backwards strategies 🎬 Here's a demo of a fill-forward function which supports PySpark, @pola.rs , @duckdb.org , pandas, cuDF, and more! 🎁 Bonus: curious about what this looks like as DuckDB SQL? We got you covered 😎
Demo of forward-fill with NarwhalsForward-fill as DuckDB SQL
121
marcogorelli.bsky.social @marcogorelli.bsky.social · 09/05/2025
✨ Narwhals now supports PySpark 🎇 If you have a dataframe-agnostic function, you can pass in `pyspark.sql.DataFrame` 📈 Here's a demo, made with @marimo.io 🎁 BONUS feature: combine with SQLFrame, to generate SQL from @pola.rs syntax 🪄
Demo of Narwhals dataframe-agnostic function which supports PySparkPlot of PySpark dataframe after converting it to PyArrowSQL generation from Polars syntax
011
marcogorelli.bsky.social @marcogorelli.bsky.social · 07/05/2025
🛠️ NVIDIA's cuDF library now runs the Narwhals test suite as part of its CI process 🙀
Narwhals tests in cuDF's CI
010
marcogorelli.bsky.social @marcogorelli.bsky.social · 02/05/2025
in netherlands?
100
marcogorelli.bsky.social @marcogorelli.bsky.social · 30/04/2025
I still name my Marimo notebooks `untitled42.py` 🙈
010