turbaszek commented on a change in pull request #9002:
URL: https://github.com/apache/airflow/pull/9002#discussion_r429848205
##########
File path: airflow/plugins_manager.py
##########
@@ -145,11 +145,12 @@ def load_entrypoint_plugins():
for entry_point in entry_points: # pylint: disable=too-many-nested-blocks
log.debug('Importing entry_point plugin %s', entry_point.name)
try:
- plugin_obj = entry_point.load()
- if is_valid_plugin(plugin_obj):
+ plugin_class = entry_point.load()
+ if is_valid_plugin(plugin_class):
+ plugin_obj = plugin_class()
Review comment:
```suggestion
plugin_instance = plugin_class()
```
WDYT?
##########
File path: airflow/plugins_manager.py
##########
@@ -145,11 +145,12 @@ def load_entrypoint_plugins():
for entry_point in entry_points: # pylint: disable=too-many-nested-blocks
log.debug('Importing entry_point plugin %s', entry_point.name)
try:
- plugin_obj = entry_point.load()
- if is_valid_plugin(plugin_obj):
+ plugin_class = entry_point.load()
+ if is_valid_plugin(plugin_class):
+ plugin_obj = plugin_class()
if callable(getattr(plugin_obj, 'on_load', None)):
plugin_obj.on_load()
- plugins.append(plugin_obj)
+ plugins.append(plugin_obj())
Review comment:
I'm not sure, but do we call here an instantiated class (via
`__call__`)? Why we do this?
----------------------------------------------------------------
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:
[email protected]