You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "George Leslie-Waksman (JIRA)" <ji...@apache.org> on 2016/09/23 17:18:20 UTC

[jira] [Issue Comment Deleted] (AIRFLOW-333) Plugins containing objects without __name__ are broken

     [ https://issues.apache.org/jira/browse/AIRFLOW-333?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

George Leslie-Waksman updated AIRFLOW-333:
------------------------------------------
    Comment: was deleted

(was: There is a fix for this. It's stuck waiting on a merge: https://github.com/apache/incubator-airflow/pull/1663)

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