Skip to content

Alternate PR to #3970#3997

Merged
mistercrunch merged 1 commit into
apache:masterfrom
mistercrunch:flask_app_mutator
Dec 4, 2017
Merged

Alternate PR to #3970#3997
mistercrunch merged 1 commit into
apache:masterfrom
mistercrunch:flask_app_mutator

Conversation

@mistercrunch
Copy link
Copy Markdown
Member

No description provided.

@john-bodley
Copy link
Copy Markdown
Member

LGTM

@mistercrunch mistercrunch merged commit eff5952 into apache:master Dec 4, 2017
@mistercrunch mistercrunch deleted the flask_app_mutator branch December 4, 2017 16:19
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
@mapto
Copy link
Copy Markdown

mapto commented Mar 22, 2019

I also need to add a before_request for #7024 to get session information from cookies. However, this PR does not seem to solve the problem: the intended use as per the provided example does not work.

FLASK_APP_MUTATOR = lambda x: x.before_request = f

results in a SyntaxError: can't assign to lambda with Python 3.6.8. Currently, assignments inside lambda are not supported in Python, and this is apparently going to change in Python 3.8.

A functional alternative to the example would be:

def attach_handler(app):
    app.before_request = f

FLASK_APP_MUTATOR = lambda app: attach_handler(app)

@mapto mapto mentioned this pull request Mar 29, 2019
@shawnzhu shawnzhu mentioned this pull request Aug 17, 2021
9 tasks
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.21.0 First shipped in 0.21.0 labels Feb 27, 2024
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.21.0 First shipped in 0.21.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants