turbaszek commented on a change in pull request #9002:
URL: https://github.com/apache/airflow/pull/9002#discussion_r429858176



##########
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:
       Currently we have:
   ```python
   plugin_class = entry_point.load() # class object
   plugin_obj = plugin_class() # class instance created via calling __init__
   plugin_obj() # we call existing instance so it has to have __call__
   ```
   What am I missing?




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


Reply via email to