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 2019/03/01 09:08:09 UTC
[GitHub] drewsonne commented on a change in pull request #4761:
[AIRFLOW-3942] Expose FAB args to plugins
drewsonne commented on a change in pull request #4761: [AIRFLOW-3942] Expose FAB args to plugins
URL: https://github.com/apache/airflow/pull/4761#discussion_r261525597
##########
File path: airflow/www/app.py
##########
@@ -151,15 +152,18 @@ def integrate_plugins():
for v in flask_appbuilder_views:
log.debug("Adding view %s", v["name"])
- appbuilder.add_view(v["view"],
- v["name"],
- category=v["category"])
+ if 'view' in v:
+ v['baseview'] = v.pop('view')
+ warnings.warn(
+ "AirflowPlugin.flask_appbuilder_views[] dictionaries should use 'baseview' instead of 'view. "
+ "Using 'view' has been deprecated and will be removed in future versions.",
+ DeprecationWarning,
+ )
+
+ appbuilder.add_view(**v)
Review comment:
i’m not sure I follow the benefit here? The intention of using kwargs is so we don’t have to worry about the underlying method interface. In code that a plugin author would never see, why would we lock down positional arguments, when we could drop all the arguments straight through to fab with kwargs?
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services