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: column filters #1652

Merged
merged 7 commits into from
Jun 20, 2024
Merged

feat: column filters #1652

merged 7 commits into from
Jun 20, 2024

Conversation

mscolnick
Copy link
Contributor

@mscolnick mscolnick commented Jun 19, 2024

📝 Summary

Closes #950

This adds "contains" and "range" filters to mo.ui.table. Specs:

  • support text (free text that contains and is case-sensitive)
  • range min and max. you can achieve <= X, >= X, == X, X - Y
  • boolean to set true/false

Not support types:

  • dates - may wait to see if this is needed. its much hard to put this in a UI that always works. for example, we would need to be smart if a range by year, month, day, seconds, etc

This works for:

  • Polars
  • Pandas

But does not work for (yet)

  • pyarrow (easy to add once we add a TransformHandler)
  • lists/dicts (could check for polars/pandas and convert, but this creates other issues with selection being a different type)

Screenshot 2024-06-20 at 2 00 34 PM
Screenshot 2024-06-20 at 2 00 22 PM
Screenshot 2024-06-20 at 2 00 09 PM
Screenshot 2024-06-20 at 1 59 34 PM

Copy link

vercel bot commented Jun 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2024 7:36pm
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2024 7:36pm

akshayka
akshayka previously approved these changes Jun 20, 2024
self._filtered_manager = self._manager
return []

if args.filters:
# TODO: don't allow no polars and pandas to get here
Copy link
Contributor

Choose a reason for hiding this comment

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

Just checking if this needs to be addressed now or if it's fine to get to later

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh woops - i did this already, forgot to remove the todo

Copy link

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.6.22-dev1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: filter tables by value in column
2 participants