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


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/plugins.py:
##########
@@ -44,9 +46,27 @@ 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:
+        try:
+            # Validate each plugin individually
+            plugin = PluginResponse.model_validate(plugin_dict)
+            valid_plugins.append(plugin)
+        except ValidationError as e:
+            logger.warning(
+                "Skipping invalid plugin due to error",
+                plugin_name=plugin_dict.get("name", "<unknown>"),
+                error=str(e),
+            )
+            continue
+
+    offset_value = offset.value or 0

Review Comment:
   Yes, The values coming from FastAPI validation won’t actually be None, but I 
added the default handling mainly because pre-commit/mypy was flagging it as a 
type error. 



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