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/10/04 10:00:26 UTC
[GitHub] [airflow] feluelle commented on a change in pull request #6252:
[AIRFLOW-4676] Make airflow/macros Pylint compatible
feluelle commented on a change in pull request #6252: [AIRFLOW-4676] Make airflow/macros Pylint compatible
URL: https://github.com/apache/airflow/pull/6252#discussion_r331423282
##########
File path: airflow/macros/__init__.py
##########
@@ -91,4 +92,4 @@ def _integrate_plugins():
from airflow.plugins_manager import macros_modules
for macros_module in macros_modules:
sys.modules[macros_module.__name__] = macros_module
- globals()[macros_module._name] = macros_module
+ globals()[macros_module.__name__.split('.')[-1]] = macros_module
Review comment:
The `_name` attribute will be set during the [make_module](https://github.com/apache/airflow/blob/88989200a66291580088188f06a6db503ac823e2/airflow/plugins_manager.py#L159).
So related to that it needs to be:
```suggestion
globals()[macros_module.__name__.lower().split('.')[-1]] = macros_module
```
But I am wondering why it is "private" when it gets only accessed from [inits](https://github.com/apache/airflow/search?utf8=%E2%9C%93&q=._name&type=) outside of its class.
I suggest to ignore it via `pylint: disable=message`, because if you want to rename the `_name` attribute it will affect all other inits as well.
----------------------------------------------------------------
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
With regards,
Apache Git Services