-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Filter Enhancement (#933) - Filter Value Dropdown #1061
Conversation
This PR is the same as #948 Sorry I closed that PR while I was fixing issues after rebasing and my force push didn't allow me to re-open it. |
Great enhancement, thanks @the-dcruz! Is there a way to select multiple options ? |
It needs to be backward compatible with the existing multi-value filters. |
@kkalyan @mistercrunch Maybe a better implementation I can try would be a freeform multiselect? |
88c37de
to
18cd7c1
Compare
18cd7c1
to
1d6923d
Compare
This would be a very helpful enhancement! |
@mistercrunch I was wondering if there was still a chance of this PR being looked into. I've periodically rebased it but will hold off until I know it will be looked at. Thanks |
Oh nice! I didn't see your updates since my last comment. I'm a bit overwhelmed with the amount of notifications and communication channels around me. This looks good, I'll fetch your branch and do some testing on our staging environment today. |
Quick question before I test, we recently had a PR to fix a bug around filtering on strings that include commas, is that handled on your side? |
@vera-liu , since you're familiar with this feature and this part of the code, would you mind doing some testing/reviewing here? |
@mistercrunch Doesn't ring a bell. Could you point me to the PR? I'll try to get that integrated. Thanks for taking a look btw! And no worries, I understand it can't be easy managing multiple popular open source projects 😄 |
@vera-liu I use the same time parameters for this query as specified for the slice. Can you show me which time params you selected? |
Yes. Does 7 Days ago actually return any data to display in the chart? |
@vera-liu I see my issue. Energy usage does not have any time column. I guess I'll ignore time in my query if there is no time column. I'll add that fix in a bit. Could you try with something time sensitive like "birth names"? |
@vera-liu I pushed the fix so it should work for the energy table now. I'll rebase as soon as you think things look good. Thanks! |
timestamp >= text(dttm_col.dttm_sql_literal(from_dttm)), | ||
timestamp <= text(dttm_col.dttm_sql_literal(to_dttm)), | ||
] | ||
qry = qry.where(and_(*time_filter)) if granularity else qry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need if granularity else qry
here? If this is inside if granularity:
it should always be true right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Forgot to remove this.
73b1553
to
b6e0b25
Compare
@vera-liu I decided that the most consistent way to integrate your fix is to wrap all the filter choices with the single quotes. This seems reasonable to me since this is a dropdown containing column values instead of column names like many of the other dropdowns. |
1623d7b
to
c872f7a
Compare
Do you mind rebasing on latest master since it has python test for filter values with commas? |
7ded4c4
to
e539882
Compare
@vera-liu Sure. Done |
Looks like another migration file was introduced after rebase, causing the tests to fail. I'll update my migration file and rebase again. |
e539882
to
91c2280
Compare
Tests look good after rebase @vera-liu |
So Sorry for the delay, I think it's looking good! I'll test it against prod db and then confirm. Could you resolve the conflicts and bump the migration in the meantime? Thank you for the patience! @the-dcruz |
please rebase so that we can merge this! |
@the-dcruz can't wait to see this in master, please rebase! |
32cd717
to
a8c3bbb
Compare
@kkalyan Sorry about the wait! I had abandoned this PR thinking it was going to be waived off until exploreV2. @mistercrunch I've rebased and retested this. |
a8c3bbb
to
8191486
Compare
…taining possible column values
8191486
to
9f6f544
Compare
@vera-liu would you make sure this gets added to the filters component in V2? |
Seems like caravel-superset renaming caused conflicts in this PR, I will try to include this feature in explore V2, but feel free to merge into V1 if you would like @the-dcruz, it's an awesome feature to have! |
This is done in master |
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2. **This update includes a security fix.** - [Release notes](https://github.com/npm/ssri/releases) - [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md) - [Commits](npm/ssri@v6.0.1...v6.0.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2. **This update includes a security fix.** - [Release notes](https://github.com/npm/ssri/releases) - [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md) - [Commits](npm/ssri@v6.0.1...v6.0.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2. **This update includes a security fix.** - [Release notes](https://github.com/npm/ssri/releases) - [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md) - [Commits](npm/ssri@v6.0.1...v6.0.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2. **This update includes a security fix.** - [Release notes](https://github.com/npm/ssri/releases) - [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md) - [Commits](npm/ssri@v6.0.1...v6.0.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Overview
This PR address the issue #933, which is to replace the filter TextField with a FreeFormSelect to make it easier for the user to know what types of values are possible for a filter.
If their desired value is not in the list, they can still type in their custom value. (Especially common for regex operation)
The feature must be enabled on the table/datasource.
Technical Changes
/filter/<datasource_type>/<datasource_id>/<column>/
values_for_column
tomodels.DruidDatasource
andmodels.SqlaTable
(migration script included)values_for_column
uses the same querystring asquery
datasources
andtables
to indicate allowing filter value selectadd_filter
inexplore.jsx
will now fix the filter IDs upon render instead of byprepForm
on query submitScreenshots
How filter looks:
Option on table:
TODO for Future PR
@mistercrunch