pierrejeambrun commented on code in PR #55673:
URL: https://github.com/apache/airflow/pull/55673#discussion_r2349307071


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/plugins.py:
##########
@@ -44,8 +46,22 @@ def get_plugins(
     offset: QueryOffset,
 ) -> PluginCollectionResponse:
     plugins_info = sorted(plugins_manager.get_plugin_info(), key=lambda x: 
x["name"])
+    valid_plugins: list[PluginResponse] = []
+    for plugin_dict in plugins_info[offset.value :][: limit.value]:
+        try:
+            # Validate each plugin individually
+            plugin = PluginResponse.model_validate(plugin_dict)
+            valid_plugins.append(plugin)
+        except Exception as e:
+            logger.warning(
+                "Skipping invalid plugin %s due to error: %s",
+                plugin_dict.get("name", "<unknown>"),
+                e,
+            )
+            continue
+

Review Comment:
   Also could you add a relevant test. 



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