-
Notifications
You must be signed in to change notification settings - Fork 16.6k
Filter Enhancement - Show column values in drop down #948
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
Conversation
|
What causes this issue in travis-ci?
|
5f91ec2 to
0931c77
Compare
|
|
caravel/views.py
Outdated
| datasource_class = models.SqlaTable \ | ||
| if datasource_type == "table" else models.DruidDatasource | ||
| datasources = ( | ||
| db.session.query(datasource_class).all() |
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.
we could probably filter the datasource by id here
4b2939c to
1253f4a
Compare
caravel/models.py
Outdated
| column_name, | ||
| from_dttm, | ||
| to_dttm, | ||
| limit=500,): |
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.
trailing comma
7f0b887 to
9603229
Compare
|
@mistercrunch @xrmx Could you guys take look when you get a chance? Thanks! |
| @@ -18,47 +18,16 @@ require('bootstrap'); | |||
|
|
|||
| require('./../caravel-select2.js'); | |||
|
|
|||
| require('../../node_modules/bootstrap-toggle/js/bootstrap-toggle.min.js'); | |||
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.
isn't this already gone in master?
|
This looks solid on first glance, I'll try to install it in our staging and play with it today. |
9603229 to
1987d3d
Compare
caravel/views.py
Outdated
| :param column: Column name to retrieve values for | ||
| :return: | ||
| """ | ||
| # TODO: Cache endpoint by user, datasource and column |
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.
Speaking of cache was wondering if it would make sense to wrap flask-cache's Cache or just create some helpers to avoid spreading the compression and python3 quirks around. What do you think @mistercrunch?
|
bump |
1987d3d to
740c212
Compare
…taining possible column values
07e4263 to
97648d9
Compare
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_columntomodels.DruidDatasourceandmodels.SqlaTable(migration script included)values_for_columnuses the same querystring asquerydatasourcesandtablesto indicate allowing filter value selectadd_filterinexplore.jsxwill now fix the filter IDs upon render instead of byprepFormon query submitScreenshots
How filter looks:

Option on table:

TODO for Future PR
@mistercrunch