mistercrunch commented on issue #4669: [sqllab] Using app context for 
processing Jinja template in async mode
URL: 
https://github.com/apache/incubator-superset/pull/4669#issuecomment-376435137
 
 
   Seems like the template processor needs to be aware of the `username` and 
the calls in `db_engine_specs` should relay the username to calls that interact 
with the engine in `models.py`.
   
   Passing it through gets pretty deep and nasty. Maybe mimicking the Flask app 
context isn't a bad idea, but I'm unclear on how to do that.
   
   At first I thought "would it be crazy would the celery worker to call REST 
endpoints?" That's probably a very bad idea.
   
   Now I'm thinking "how about doing the template rendering ahead of time in 
the web request and putting the rendered template in the db for the worker to 
run?".

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


With regards,
Apache Git Services

Reply via email to