How can I attach a value at login time for Jinja and reuse it later on in Apache Superset's SQLLab? How can I attach a value at login time for Jinja and reuse it later on in Apache Superset's SQLLab? flask flask

How can I attach a value at login time for Jinja and reuse it later on in Apache Superset's SQLLab?


Accessing the flask.g context is not that straight forward as execution happens on the celery worker. The celery worker has no access to the Flask context (also note depending on configuration it might even run in async mode).

Internal JINJA variables like current_user needed some additional work in Supersets codebase to be made available, but there's no general mechanism to open up user defined JINJA variables out of the box at the time of writing.