uranusjr commented on code in PR #32692:
URL: https://github.com/apache/airflow/pull/32692#discussion_r1272122138


##########
airflow/plugins_manager.py:
##########
@@ -267,6 +274,27 @@ def load_plugins_from_plugin_directory():
             import_errors[file_path] = str(e)
 
 
+def load_providers_plugins():
+    from airflow.providers_manager import ProvidersManager
+
+    global import_errors

Review Comment:
   I don’t think this is needed?



##########
airflow/providers_manager.py:
##########
@@ -1024,6 +1039,20 @@ def _discover_config(self) -> None:
             if provider.data.get("config"):
                 self._provider_configs[provider_package] = 
provider.data.get("config")
 
+    def _discover_plugins(self) -> None:
+        """Retrieve all plugins defined in the providers."""
+        for provider_package, provider in self._provider_dict.items():
+            if provider.data.get("plugins"):
+                for plugin_dict in provider.data["plugins"]:
+                    if _correctness_check(provider_package, 
plugin_dict["plugin-class"], provider):
+                        self._plugins_set.add(
+                            PluginInfo(
+                                name=plugin_dict["name"],
+                                plugin_class=plugin_dict["plugin-class"],
+                                provider_name=provider_package,
+                            )
+                        )

Review Comment:
   ```suggestion
               for plugin_dict in provider.data.get("plugins", ()):
                   if not _correctness_check(provider_package, 
plugin_dict["plugin-class"], provider):
                       continue
                   self._plugins_set.add(
                       PluginInfo(
                           name=plugin_dict["name"],
                           plugin_class=plugin_dict["plugin-class"],
                           provider_name=provider_package,
                       )
                   )
   ```
   
   Should we also add a log message when `_correctness_check` fails?



##########
airflow/plugins_manager.py:
##########
@@ -267,6 +274,27 @@ def load_plugins_from_plugin_directory():
             import_errors[file_path] = str(e)
 
 
+def load_providers_plugins():
+    from airflow.providers_manager import ProvidersManager
+
+    global import_errors

Review Comment:
   I don’t think this is needed?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to