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

ASF GitHub Bot commented on AIRFLOW-3308:
-----------------------------------------

ckljohn opened a new pull request #4153: [AIRFLOW-3308] Fix plugins import
URL: https://github.com/apache/incubator-airflow/pull/4153
 
 
   Revert #3906 partially.
   
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [x] My PR addresses the following [Airflow 
Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references 
them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR"
     - https://issues.apache.org/jira/browse/AIRFLOW-3308
     - In case you are fixing a typo in the documentation you can prepend your 
commit with \[AIRFLOW-XXX\], code changes always need a Jira issue.
   
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI 
changes:
   Plugins import is broken after #3906 . This PR is to revert 
`airflow.__init__`
   
   ### Tests
   
   - [ ] My PR adds the following unit tests __OR__ does not need testing for 
this extremely good reason:
   
   ### Commits
   
   - [x] My commits all reference Jira issues in their subject lines, and I 
have squashed multiple commits if they address the same issue. In addition, my 
commits follow the guidelines from "[How to write a good git commit 
message](http://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [ ] In case of new functionality, my PR adds documentation that describes 
how to use it.
     - When adding new operators/hooks/sensors, the autoclass documentation 
generation needs to be added.
   
   ### Code Quality
   
   - [x] Passes `flake8`
   

----------------------------------------------------------------
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:
[email protected]


> Plugins import is broken
> ------------------------
>
>                 Key: AIRFLOW-3308
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3308
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: plugins
>    Affects Versions: 2.0.0
>            Reporter: John Cheng
>            Assignee: John Cheng
>            Priority: Major
>             Fix For: 2.0.0
>
>
> #3906 removed {noformat}_integrate_plugins(){noformat} from 
> {noformat}airflow.__init__{noformat} which breaks plugins import.
> {noformat}
> [2018-11-07 02:06:21,372] {{plugins_manager.py:83}} DEBUG - Importing plugin 
> module /usr/local/airflow/dags/plugins/sensors/spark_submit_sensor.py
> [2018-11-07 02:06:21,376] {{plugins_manager.py:83}} DEBUG - Importing plugin 
> module /usr/local/airflow/dags/plugins/sensors/__init__.py
> [2018-11-07 02:06:21,380] {{plugins_manager.py:83}} DEBUG - Importing plugin 
> module /usr/local/airflow/dags/plugins/sensors/glue_sensor.py
> [2018-11-07 02:06:21,389] {{plugins_manager.py:83}} DEBUG - Importing plugin 
> module /usr/local/airflow/dags/plugins/operators/postgres_operator.py
> [2018-11-07 02:06:21,393] {{plugins_manager.py:83}} DEBUG - Importing plugin 
> module /usr/local/airflow/dags/plugins/operators/service_catalog_operator.py
> [2018-11-07 02:06:21,397] {{plugins_manager.py:83}} DEBUG - Importing plugin 
> module /usr/local/airflow/dags/plugins/operators/glue_operator.py
> [2018-11-07 02:06:21,400] {{plugins_manager.py:83}} DEBUG - Importing plugin 
> module /usr/local/airflow/dags/plugins/operators/__init__.py
> [2018-11-07 02:06:21,464] {{plugins_manager.py:83}} DEBUG - Importing plugin 
> module /usr/local/airflow/dags/plugins/hooks/redis_cluster_hook.py
> [2018-11-07 02:06:21,472] {{plugins_manager.py:83}} DEBUG - Importing plugin 
> module /usr/local/airflow/dags/plugins/hooks/athena_hook.py
> [2018-11-07 02:06:21,480] {{plugins_manager.py:83}} DEBUG - Importing plugin 
> module /usr/local/airflow/dags/plugins/hooks/slack_hook.py
> [2018-11-07 02:06:21,486] {{plugins_manager.py:83}} DEBUG - Importing plugin 
> module /usr/local/airflow/dags/plugins/hooks/__init__.py
> [2018-11-07 02:06:21,490] {{plugins_manager.py:83}} DEBUG - Importing plugin 
> module /usr/local/airflow/dags/plugins/hooks/s3_hook.py
> [2018-11-07 02:06:21,497] {{plugins_manager.py:103}} DEBUG - Creating module 
> airflow.operators.my_plugins
> [2018-11-07 02:06:21,498] {{plugins_manager.py:103}} DEBUG - Creating module 
> airflow.sensors.my_plugins
> [2018-11-07 02:06:21,498] {{plugins_manager.py:103}} DEBUG - Creating module 
> airflow.hooks.my_plugins
> [2018-11-07 02:06:21,498] {{plugins_manager.py:103}} DEBUG - Creating module 
> airflow.executors.my_plugins
> [2018-11-07 02:06:21,499] {{plugins_manager.py:103}} DEBUG - Creating module 
> airflow.macros.my_plugins
> [2018-11-07 02:06:54,851] {{models.py:355}} DEBUG - Importing 
> /usr/local/airflow/dags/my_dag.py
> [2018-11-07 02:06:54,856] {{models.py:369}} ERROR - Failed to import: 
> /usr/local/airflow/dags/my_dag.py
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.6/site-packages/airflow/models.py", line 366, 
> in process_file
>     m = imp.load_source(mod_name, filepath)
>   File "/usr/local/lib/python3.6/imp.py", line 172, in load_source
>     module = _load(spec)
>   File "<frozen importlib._bootstrap>", line 684, in _load
>   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
>   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
>   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
>   File "/usr/local/airflow/dags/user_profile.py", line 6, in <module>
>     from airflow.hooks.my_plugins import SlackWebhookHook
> ModuleNotFoundError: No module named 'airflow.hooks.my_plugins'
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to