betodealmeida opened a new pull request #12088:
URL: https://github.com/apache/incubator-superset/pull/12088


   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   @ktmud pointed out in #11803 that `GET_FEATURE_FLAG_FUNC` might use the app 
context, breaking the CLI. This PR fixes it.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   N/A
   
   ### TEST PLAN
   <!--- What steps should be taken to verify the changes -->
   
   Added this to my `superset_config.py`:
   
   ```python
   # pylint: disable=invalid-name
   def GET_FEATURE_FLAGS_FUNC(feature_flags_dict: Dict[str, bool]) -> Dict[str, 
bool]:
       from flask import g
   
       if hasattr(g, "user") and g.user.is_active:
           feature_flags_dict["some_feature"] = g.user and g.user.id == 5
       return feature_flags_dict
   ```
   
   The CLI works as expected.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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