You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/12/08 17:05:29 UTC

[GitHub] [incubator-superset] lilila commented on issue #10817: Jinja filter_values function not working in charts used as annotation in another chart

lilila commented on issue #10817:
URL: https://github.com/apache/incubator-superset/issues/10817#issuecomment-740766590


   Dear @oashton , 
   
   I wrote this lite patch to get annotation considering extra_filters in Explore view as well. 
   I add these lines at line 260 in your screenshot 
   
   `    //case for explore view (have extra params given to annotation)       
       var new_extra_from_adhoc = [];
       if (!fd.extra_filters && fd.adhoc_filters){
           for(var i=0; i<fd.adhoc_filters.length; i++){
               if (fd.adhoc_filters[i]['isExtra']){
                       var new_extra = {"col":fd.adhoc_filters[i]['subject'],
                                        "op": fd.adhoc_filters[i]['operator'],
                                        "val": fd.adhoc_filters[i]['comparator']};
                       new_extra_from_adhoc.push(new_extra);}
               }
           sliceFormData.extra_filters = new_extra_from_adhoc;
       }`
   
   @villebro , I don't know if you remember but we discussed this point. 
   The problem was that in explore mode, extra_filters are already merge with adhoc filters so they were not passed to the annotations. The code snippet (sorry for the quality I never code in Javascript) simply recreates the extra_filters from the adhoc_filters available in Explore mode 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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