superset-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] nbonnotte commented on issue #5374: Filters are not kept when exploring from dashboard
Date Fri, 20 Jul 2018 13:32:39 GMT
nbonnotte commented on issue #5374: Filters are not kept when exploring from dashboard
URL: https://github.com/apache/incubator-superset/issues/5374#issuecomment-406601741
 
 
   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?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Mime
View raw message