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

Add enhanced filter to autocomplete #221

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Thorben-D
Copy link

This PR adds a new field, enhanced_filter to AutoCompleteBuilder.
enhanced_filter takes the following arguments:

  • has_column - Name of the required column
  • filter - Predicate used for filtering

Iff in the table to be filtered, there exists a column <has_column>, the filter will be executed.

Consider the following example:
image

Let's say the table Food is populated with a green apple and a red pepper.
If I want to filter for green food, I would do value_filter: {color_id: <green_id>}.
This works as long as a user doesn't try to filter this by type = . In that case, value_filter will be applied to the table Type, which doesn't have a color_id column, causing an exception.
enhanced_filter prevents this by first checking for the existence of the required column before filtering.

Thorben-D added 2 commits June 4, 2024 16:11
- "enhanced_filter" requires a given column to be present before doing any filtering
- "enhanced_filter" takes precedence over "value_filter"
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.

1 participant