cccs-jc edited a comment on issue #13943:
URL: https://github.com/apache/superset/issues/13943#issuecomment-829186409


   The issue with the second approach is that a viz needs to handle these type 
of filters specifically. The generic adhoc filtering capabilities would be 
lost. I think this would not work with native filters since these emit regular 
filters (I'm making this assumption)
   
   Option 1 treats filters generically. From a UI point of view it does not  
distinguish between a filter which will be applied by sqla/models.py and one 
applied by the jinja template.
   
   Roughly speaking, the sqla/models.py adds where conditions around the 
virtual table in the following order:
   
   1. add conditions corresponding to UI filter (adhoc filters etc)
   2. add conditions specified in RLS
   3. add conditions for Extras
   4. add conditions for apply_fetch_values_predicate
   5. add conditions for granularity 
    
   Option 1's propositions is:
   Since a jinja template handles a filter (at step 0) it informs (can inform) 
the sqla/models.py to skip step 1 (and only step 1). 
   
   I don't believe option 1 would break RLS. I'm I missing something?
   
   The example above is very simplistic. It's a hard coded IN condition
   `WHERE full_name IN ( {{ "'" + "', '".join(filter_values('full_name')) + "'" 
}} )`
   
   The person designing the query might want to support additional operators 
`<, !=, LIKE`.
   
   In the explore UI the user can construct a adhoc filter specifying the 
operator and the value ex: `salary > 40k`. It's easy for the jinja template to 
get at operator and value being applied to the `salary` or `name` column. The 
jinja template can thus  render the corresponding conditions.
   


-- 
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to