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


##########
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:
   By taking a look at the defiition of `offset_value` and `limit_value` those 
can't be None. You're having type error because mypy is having a hard time 
understanding how fastapi validation works I guess. But that's fine.



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