You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/10/21 13:46:41 UTC

[GitHub] [airflow] joebeeson commented on a change in pull request #10987: Fix: add support for no-menu plugin views (#10788)

joebeeson commented on a change in pull request #10987:
URL: https://github.com/apache/airflow/pull/10987#discussion_r509297843



##########
File path: airflow/www/extensions/init_views.py
##########
@@ -73,8 +73,12 @@ def init_plugins(app):
     appbuilder = app.appbuilder
 
     for view in plugins_manager.flask_appbuilder_views:
-        log.debug("Adding view %s", view["name"])
-        appbuilder.add_view(view["view"], view["name"], category=view["category"])
+        try:
+            log.debug("Adding view %s with menu", view["name"])
+            appbuilder.add_view(view["view"], view["name"], category=view["category"])
+        except KeyError:

Review comment:
       The outcome should be the same though: if `name`, `category` or `view` is missing a `KeyError` is raised and the other path is ran -- if a missing `view` key _was the cause_ of the exception then it will be raised (again) below.
   
   Maybe not the clearest from an error point of view but I think it still satisfies the intent?




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