You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/10/02 06:44:20 UTC

[jira] [Commented] (AIRFLOW-333) Plugins containing objects without __name__ are broken

    [ https://issues.apache.org/jira/browse/AIRFLOW-333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15539874#comment-15539874 ] 

ASF subversion and git services commented on AIRFLOW-333:
---------------------------------------------------------

Commit eb5982d4aac135051666d2977bbf6adfc8b9e2a7 in incubator-airflow's branch refs/heads/master from [~gwax]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=eb5982d ]

[AIRFLOW-333][AIRFLOW-258] Fix non-module plugin components

* Distinguish between module and non-module plugin
components
* Fix handling of non-module plugin components

  * admin views, flask blueprints, and menu links
need to not be
    wrapped in modules

* Fix improper use of zope.deprecation.deprecated

  * zope.deprecation.deprecated does NOT support
classes as
    first parameter
  * deprecating classes must be handled by calling
the deprecate
    function on the class name

* Added tests for plugin loading
* Updated plugin documentation to match test
plugin
* Updated executors to always load plugins
* More logging

Closes #1738 from gwax/plugin_module_fixes


> Plugins containing objects without __name__ are broken
> ------------------------------------------------------
>
>                 Key: AIRFLOW-333
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-333
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: core, plugins
>    Affects Versions: Airflow 1.8
>            Reporter: George Leslie-Waksman
>            Assignee: George Leslie-Waksman
>
> Using the sample plugin from the documentation: https://pythonhosted.org/airflow/plugins.html
> And running against master, results in:
> {noformat}
> [2016-07-13 16:35:01,662] {__init__.py:50} INFO - Using executor SequentialExecutor
> Traceback (most recent call last):
>   File "/Users/waksman/.pyenv/versions/3.5.1/bin/airflow", line 17, in <module>
>     from airflow import configuration
>   File "/Users/waksman/.pyenv/versions/3.5.1/lib/python3.5/site-packages/airflow/__init__.py", line 82, in <module>
>     operators._integrate_plugins()
>   File "/Users/waksman/.pyenv/versions/3.5.1/lib/python3.5/site-packages/airflow/operators/__init__.py", line 103, in _integrate_plugins
>     from airflow.plugins_manager import operators as _operators
>   File "/Users/waksman/.pyenv/versions/3.5.1/lib/python3.5/site-packages/airflow/plugins_manager.py", line 109, in <module>
>     make_module('airflow.www.admin_views' + p.name, p.admin_views))
>   File "/Users/waksman/.pyenv/versions/3.5.1/lib/python3.5/site-packages/airflow/plugins_manager.py", line 97, in make_module
>     module.__dict__.update((o.__name__, o) for o in objects)
>   File "/Users/waksman/.pyenv/versions/3.5.1/lib/python3.5/site-packages/airflow/plugins_manager.py", line 97, in <genexpr>
>     module.__dict__.update((o.__name__, o) for o in objects)
> AttributeError: 'TestView' object has no attribute '__name__'
> {noformat}
> The issue seems to be because of: https://github.com/apache/incubator-airflow/blob/master/airflow/plugins_manager.py#L97
> This line requires that all objects in a plugin module have a '__name__' attribute. This works just fine for operators, hooks, and executors, which are all classes (and have a __name__) but fails for views, blueprints, and links, which are instances (and do not have __name__).
> This appears to have been introduced in https://github.com/apache/incubator-airflow/commit/851adc5547597ec51743be4bc47d634c77d6dc17



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)