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 2019/05/22 10:21:07 UTC

[GitHub] [incubator-superset] duffar12 opened a new issue #7580: Queries using current_username() method do not run properly when caching is enabled

duffar12 opened a new issue #7580: Queries using current_username() method do not run properly when caching is enabled
URL: https://github.com/apache/incubator-superset/issues/7580
 
 
   
   OS - Ubuntu 16.04
   
   When a query is defined using a function. For example 
            SELECT * FROM user WHERE username '{{current_username()}}' 
   this will run only run as expected the first time it is run. If another user runs the exact same query from his or her account, the result will be pulled from the cache rather than running the query again with a different username. The problem disappears if caching is disabled
   
   ### Expected results
   
   When caching is enabled, queries using the current_username() method, should not produce the same results for different users even if all other query parameters are the same.
   
   ### Actual results
   
   When caching is enabled, queries using the current_username() method, DO produce the same results for different users if all other query parameters are the sam
   
   
   #### How to reproduce the bug
   
   1. Enable a redis cache
   2. Create 2 different users with admin role e.g 'user1' and 'user2'
   3. Create a Users table with fields username and metric
   4. Add 2 records to the Users table 'user1, 1' and 'user2, 2'
   5. login to superset as user1 and create a table chart to view the Users table. Specify a filter of username = '{{current_username()}}'
   6. On a different browser login to superset as user2. Create the exact same table as you created for user1. 
   7. Notice that the table presented on user2 account actually shows the data for user1
   8. Disable the redis cache and repeat steps 1-7. Notice that the problem is not present when caching is disabled
   
   ### Environment
   
   (please complete the following information):
   
   - superset version: 0.33.0
   - python version: 3.6.8
   
   
   ### Checklist
   
   Make sure these boxes are checked before submitting your issue - thank you!
   
   - [X] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [X] I have reproduced the issue with at least the latest released version of superset.
   - [X] I have checked the issue tracker for the same issue and I haven't found one similar.
   
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

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