bbovenzi commented on code in PR #74278:
URL: https://github.com/apache/airflow/pull/74278#discussion_r4198053837


##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/plugins.py:
##########
@@ -69,16 +69,19 @@ class AppBuilderMenuItemResponse(BaseModel):
     category: str | None = None
 
 
-class PluginAppliesToResponse(BaseModel):
-    """Serializer for the optional Dag/task scoping criteria of a UI plugin."""
+class PluginAppliesToResponse(RootModel[dict[str, list[str]]]):
+    """
+    Serializer for the optional scoping criteria of a UI plugin.
 
-    model_config = ConfigDict(extra="forbid")
+    An open map of dotted field path to the values that path may take -- not a 
closed set of
+    criteria. ``{"state": ["failed"], "dag.tags.name": ["ml"]}`` scopes to 
failed entities of
+    ml-tagged Dags. An unqualified path is rooted at the entity the 
``destination`` is about;
+    a path may instead name a related record (``dag``, ``dag_run``, ``task``, 
``task_instance``)
+    as its first segment. Matching is equality against the listed values, OR 
within a path and
+    AND across paths, and is evaluated client-side.
+    """
 
-    dag_tags: list[str] | None = None
-    dag_ids: list[str] | None = None
-    task_ids: list[str] | None = None
-    operators: list[str] | None = None
-    operator_names: list[str] | None = None
+    root: dict[str, list[str]] = Field(default_factory=dict)

Review Comment:
   `_validate_applies_to` now drops null-valued paths before the block is 
serialized but will keep any valid ones.



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