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

Filters are not kept when exploring from dashboard #5374

Closed
3 tasks done
nbonnotte opened this issue Jul 11, 2018 · 9 comments
Closed
3 tasks done

Filters are not kept when exploring from dashboard #5374

nbonnotte opened this issue Jul 11, 2018 · 9 comments
Labels
!deprecated-label:bug Deprecated label - Use #bug instead inactive Inactive for >= 30 days

Comments

@nbonnotte
Copy link
Contributor

  • I have checked the superset logs for python stacktraces and included it here as text if any
  • I have reproduced the issue with at least the latest released version of superset
  • I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

{"GIT_SHA": "b480cb344433d58d41594dca171e90287c57dc4a", "version": "0.26.3"}

Expected results

I have a dashboard with a filter box. I use it to filter. A graph on the dashboard looks interesting, I click on "explore". The filters used to be preserved, and that was an awesome feature.

Actual results

The filters are forgotten :(

@mistercrunch
Copy link
Member

@GabeLoins I just reproduced this and the filter was actually applied (the data is filtered) but not restored in the Filters component.

@mistercrunch mistercrunch added the !deprecated-label:bug Deprecated label - Use #bug instead label Jul 11, 2018
@nbonnotte
Copy link
Contributor Author

@mistercrunch That's very strange, because my users and I can confirm the filters are not applied

@mistercrunch
Copy link
Member

Oh interesting, I simply opened the World's Bank example, applied a filter and followed the link and things were filtered.

@nbonnotte
Copy link
Contributor Author

Interesting indeed 😃
What kind of information should I look for to put more light on what is happening?

@nbonnotte
Copy link
Contributor Author

I just reproduced it.

I have a graph defined on a table with a preset filter (source = "TRAVORAMA").

On the dashboard that includes it, I used a filter box to filter on "Since 1 month ago" and label_categorie_initiale IN ("Pose+de+clôture+en+grillage+rigide+(1881)"). Then, when exploring the graph, I got the following URL:

http://192.168.1.144/superset/explore/?form_data={
"datasource":"20__table",
"viz_type":"big_number_total",
"slice_id":213,
"granularity_sqla":"ts_depot",
"time_grain_sqla":null,
"since":"1+months+ago",
"until":"",
"metric":"sum__nbre_projets",
"adhoc_filters":[{"subject":"source","operator":"==","filterOptionName":"filter_hf45d8jnxcr_yani27kg2u","expressionType":"SIMPLE","sqlExpression":null,"fromFormData":true,"comparator":"TRAVORAMA","clause":"WHERE"}],
"y_axis_format":".0f",
"timeseries_limit_metric":null,
"include_search":false,
"percent_metrics":[],
"color_pn":true,
"include_time":false,
"table_timestamp_format":"%Y-%m-%d+%H:%M:%S",
"table_filter":false,
"groupby":[],
"url_params":{},
"page_length":0,
"row_limit":10000,
"order_desc":true,
"having":"",
"order_by_cols":[],
"filters":[{"col":"source","val":"TRAVORAMA","op":"=="},{"col":"label_categorie_initiale","val":["Pose+de+clôture+en+grillage+rigide+(1881)"],"op":"in"}],
"all_columns":["ts_depot","nom_projet","label_categorie_initiale","etat","nbre_selections_brut","Nbre+recrédits"],
"metrics":[],
"having_filters":[],
"align_pn":false,
"where":""
}

The result is that the temporal filter that was defined with the Filter box is preserved, as is the filter on the source field defined on the graph independently from the Filter box. The condition on label_categorie_initiale has not been kept though. Both the chart definition form and the actual result displayed match.

In explore, when I manually add the missing filter, the URL changes into

http://192.168.144/superset/explore/?form_data={
...
"adhoc_filters":[{"subject":"source","operator":"==","filterOptionName":"filter_hf45d8jnxcr_yani27kg2u","expressionType":"SIMPLE","sqlExpression":null,"fromFormData":true,"comparator":"TRAVORAMA","clause":"WHERE"},{"subject":"label_categorie_initiale","operator":"in","filterOptionName":"filter_t892zpelzhm_9rszhbvraaq","expressionType":"SIMPLE","sqlExpression":null,"fromFormData":true,"comparator":["\"Pose+de+clôture+en+grillage+rigide+(1881)\""],"clause":"WHERE"}],
...
"filters":[{"col":"source","val":"TRAVORAMA","op":"=="},{"col":"label_categorie_initiale","val":["\"Pose+de+clôture+en+grillage+rigide+(1881)\""],"op":"in"}],
...
}

Now there are two adhoc_filters.

Conversely, if I now remove completely the adhoc_filters directly from the explore URL, it reverts to the first scenario (temporal filter + preset filter defined on the chart). If instead I remove completely the filters and put back the adhoc_filters, everything works fine (temporal filter + preset filter defined on the chart + manual filter).

It seems therefore the filters option is ignored, and this could be the root of the problem, because when exploring after using a filter box the filters seem to be passed only through the filters argument.

What should be the normal behavior?

@michellethomas
Copy link
Contributor

I'm noticing this issue too, I can try to take a look.

@michellethomas
Copy link
Contributor

This issue should be fixed by #5525

@Fingerzam
Copy link

There's still the issue that the Filters component does not have the applied filters.

@stale
Copy link

stale bot commented Apr 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

@stale stale bot added the inactive Inactive for >= 30 days label Apr 10, 2019
@stale stale bot closed this as completed Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
!deprecated-label:bug Deprecated label - Use #bug instead inactive Inactive for >= 30 days
Projects
None yet
Development

No branches or pull requests

4 participants