narwhals-dev / narwhals

Lightweight and extensible compatibility layer between dataframe libraries!
https://narwhals-dev.github.io/narwhals/
MIT License
611 stars 91 forks source link

feat: support `constraints` in `DataFrame.filter` #1417

Closed raisadz closed 2 days ago

raisadz commented 4 days ago

What type of PR is this? (check all applicable)

Related issues

Checklist

If you have comments or can explain your changes, please do so below

dangotbanned commented 3 days ago

@raisadz thank you for this!

Not sure if this suggestion could fit into the narwhals docs, but thought I'd share a bit more on the use-case.

I'm using this with an unpacked TypedDict that mirrors the schema of a static file. So this feature allows for rich static typing feedback; provided you have control over the data source

image

image

image

No worries at all if not, thanks again for working on this PR 🎉