Lee-W commented on code in PR #69761:
URL: https://github.com/apache/airflow/pull/69761#discussion_r3947050465
##########
shared/plugins_manager/src/airflow_shared/plugins_manager/plugins_manager.py:
##########
@@ -85,6 +87,62 @@ class AirflowPluginException(Exception):
"""Exception when loading plugin."""
+BaseDestinationLiteral = Literal["nav", "dag", "dag_run", "task",
"task_instance", "asset", "base"]
+
+
+class AppliesToDict(TypedDict):
+ """Dictionary structure for the optional ``applies_to`` scoping block on
UI plugins."""
+
+ dag_tags: NotRequired[list[str] | None]
+ dag_ids: NotRequired[list[str] | None]
+ task_ids: NotRequired[list[str] | None]
+ operators: NotRequired[list[str] | None]
+ operator_names: NotRequired[list[str] | None]
+
+
+class _BaseUIDict(TypedDict):
+ """Shared UI fields mirroring ``BaseUIResponse``."""
+
+ name: str
+ icon: NotRequired[str]
+ icon_dark_mode: NotRequired[str]
+ url_route: NotRequired[str]
+ category: NotRequired[str]
+ nav_top_level: NotRequired[bool]
+ applies_to: NotRequired[AppliesToDict | None]
+
+
+class ExternalViewDict(_BaseUIDict):
+ """Dictionary structure for entries in AirflowPlugin.external_views."""
+
+ href: str
+ destination: NotRequired[BaseDestinationLiteral]
+
+
+class ReactAppDict(_BaseUIDict):
+ """Dictionary structure for entries in AirflowPlugin.react_apps."""
+
+ bundle_url: str
+ destination: NotRequired[Literal[BaseDestinationLiteral, "dashboard",
"dag_overview", "task_overview"]]
+
+
+class FastAPIAppDict(TypedDict):
+ """Dictionary structure for entries in AirflowPlugin.fastapi_apps."""
+
+ app: Any
+ url_prefix: str
+ name: NotRequired[str]
Review Comment:
Just looked into
[FastAPIAppResponse](https://github.com/apache/airflow/blob/577496acc3b99767c24e4146e02f1a0c308d6a95/airflow-core/src/airflow/api_fastapi/core_api/datamodels/plugins.py#L32).
it's not really a minor. is there any reason we need to relax it? same for
`ReactAppDict` and `ExternalViewDict`
--
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]