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/09/10 19:59:01 UTC
[GitHub] [airflow] maiorBoltach opened a new issue #10868: on_load method is not working for plugins located in folder
maiorBoltach opened a new issue #10868:
URL: https://github.com/apache/airflow/issues/10868
**Apache Airflow version**: 1.10.12
**Environment**:
- **Cloud provider or hardware configuration**: Google Cloud, custom-8-16384
- **OS** (e.g. from /etc/os-release): CentOS Linux release 7.7.1908 (Core)
- **Kernel** (e.g. `uname -a`): 3.10.0-1062.18.1.el7.x86_64 #1 SMP Tue Mar 17 23:49:17 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
**What happened**:
Class method [on_load](https://github.com/apache/airflow/blob/ce66bc944d246aa3b51cce6e2fc13cd25da08d6e/airflow/plugins_manager.py#L102) of AirflowPlugin class doesn't run after plugins located in plugin folder, only for plugins installed through pip.
**What you expected to happen**:
Method 'on_load' should run on plugins initialization, that are located in plugin folder
**How to reproduce it**:
1) Create plugin with next code and place it in plugins folder:
```
class TestPlugin(AirflowPlugin):
menu_links = [MenuLink(category='Google', name='Google', url='google.com')]
@classmethod
def on_load(cls, *args, **kwargs):
raise AirflowPluginException("Test On Load Exception")
```
2) Reload webserver.
_Result_: Webserver logs are empty, new menu appeared in UI.
_Expected result_: Webserver logs should contain information with raised exception, new menu shouldn't appear in UI.
_Reason_: on_load method is called only for airflow.plugins.* entry_points
https://github.com/apache/airflow/blob/ce66bc944d246aa3b51cce6e2fc13cd25da08d6e/airflow/plugins_manager.py#L152
**Additional information**: It is not clear what is the reason for skipping this method call for plugins contained in the folder. At the same time, plugin validation successfully run for plugins from a folder and installed via a package. Validation uses validate method in same AirflowPlugin class and can be extended by user.
https://github.com/apache/airflow/blob/b9dc3c51ba2cba1c61d327488cecf2623d6445b3/airflow/plugins_manager.py#L96
----------------------------------------------------------------
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
[GitHub] [airflow] mik-laj commented on issue #10868: on_load method is not working for plugins located in folder
Posted by GitBox <gi...@apache.org>.
mik-laj commented on issue #10868:
URL: https://github.com/apache/airflow/issues/10868#issuecomment-690687844
@maiorBoltach Yes. We are open to contributions. I assigned you to this ticket.
Contributor guide: https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst
----------------------------------------------------------------
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
[GitHub] [airflow] mik-laj edited a comment on issue #10868: on_load method is not working for plugins located in folder
Posted by GitBox <gi...@apache.org>.
mik-laj edited a comment on issue #10868:
URL: https://github.com/apache/airflow/issues/10868#issuecomment-690687844
@maiorBoltach Yes. We are open to contributions from everyone. I assigned you to this ticket.
Contributor guide: https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst
----------------------------------------------------------------
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
[GitHub] [airflow] maiorBoltach commented on issue #10868: on_load method is not working for plugins located in folder
Posted by GitBox <gi...@apache.org>.
maiorBoltach commented on issue #10868:
URL: https://github.com/apache/airflow/issues/10868#issuecomment-691561229
@mik-laj should I also make PR for 1-10 version or we leave it only in 2.0?
----------------------------------------------------------------
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
[GitHub] [airflow] mik-laj commented on issue #10868: on_load method is not working for plugins located in folder
Posted by GitBox <gi...@apache.org>.
mik-laj commented on issue #10868:
URL: https://github.com/apache/airflow/issues/10868#issuecomment-690688512
It' a real bug. See: airflow.plugins_manager.load_plugins_from_plugin_directory This does not call the on_load method.
----------------------------------------------------------------
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
[GitHub] [airflow] mik-laj commented on issue #10868: on_load method is not working for plugins located in folder
Posted by GitBox <gi...@apache.org>.
mik-laj commented on issue #10868:
URL: https://github.com/apache/airflow/issues/10868#issuecomment-691574685
Only for master. we are not making non-critical changes to 1.10
----------------------------------------------------------------
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
[GitHub] [airflow] maiorBoltach edited a comment on issue #10868: on_load method is not working for plugins located in folder
Posted by GitBox <gi...@apache.org>.
maiorBoltach edited a comment on issue #10868:
URL: https://github.com/apache/airflow/issues/10868#issuecomment-690686788
If this is really a bug, can I contribute?
----------------------------------------------------------------
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
[GitHub] [airflow] mik-laj closed issue #10868: on_load method is not working for plugins located in folder
Posted by GitBox <gi...@apache.org>.
mik-laj closed issue #10868:
URL: https://github.com/apache/airflow/issues/10868
--
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
[GitHub] [airflow] maiorBoltach commented on issue #10868: on_load method is not working for plugins located in folder
Posted by GitBox <gi...@apache.org>.
maiorBoltach commented on issue #10868:
URL: https://github.com/apache/airflow/issues/10868#issuecomment-690686788
If this is really a bug, can I fix it by myself?
----------------------------------------------------------------
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