Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support constraints in DataFrame.filter #1417

Merged
merged 8 commits into from
Nov 23, 2024

Conversation

raisadz
Copy link
Contributor

@raisadz raisadz commented Nov 21, 2024

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

  • πŸ’Ύ Refactor
  • ✨ Feature
  • πŸ› Bug Fix
  • πŸ”§ Optimization
  • πŸ“ Documentation
  • βœ… Test
  • 🐳 Other

Related issues

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

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

@github-actions github-actions bot added the enhancement New feature or request label Nov 21, 2024
@raisadz raisadz marked this pull request as ready for review November 22, 2024 10:19
@dangotbanned
Copy link

dangotbanned commented Nov 22, 2024

@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 πŸŽ‰

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @raisadz , awesome work here!

and thanks @dangotbanned for the suggestion + review

I like TypedDict but I'm not sure about adding it to the filter docstring or it risks getting too long - perhaps we need a "tips and tricks" page in the docs?

@MarcoGorelli MarcoGorelli merged commit 2c368d2 into narwhals-dev:main Nov 23, 2024
23 checks passed
dangotbanned added a commit to vega/altair that referenced this pull request Nov 24, 2024
Feature has been adopted upstream in narwhals-dev/narwhals#1417
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: support constraints in DataFrame.filter
3 participants