Add TypedDict type hints for AirflowPlugin list fields - #69761
Open
sivavarma-x wants to merge 7 commits into
Open
Add TypedDict type hints for AirflowPlugin list fields#69761sivavarma-x wants to merge 7 commits into
sivavarma-x wants to merge 7 commits into
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
sivavarma-x
force-pushed
the
wip/issue#62222
branch
2 times, most recently
from
July 17, 2026 16:28
4aed6ab to
b2bee89
Compare
sivavarma-x
force-pushed
the
wip/issue#62222
branch
from
August 9, 2026 06:40
b2bee89 to
a548e97
Compare
…wares and Callable for macros
…m airflow.plugins_manager
sivavarma-x
force-pushed
the
wip/issue#62222
branch
from
August 16, 2026 06:24
73ff892 to
7a97e44
Compare
sivavarma-x
marked this pull request as ready for review
August 16, 2026 06:53
sivavarma-x
requested review from
Lee-W,
amoghrajesh,
ashb,
dheerajturaga,
gopidesupavan,
jscheffl,
kaxil,
potiuk and
shubhamraj-git
as code owners
August 16, 2026 06:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Most
AirflowPluginlist fields (external_views,react_apps,fastapi_apps,fastapi_root_middlewares,macros) were typed aslist[Any], giving plugin authors no static signal about the shape of the entries they're expected to supply.This PR introduces
TypedDictdefinitions inairflow_shared.plugins_managerthat mirror the corresponding API response models (ExternalViewResponse,ReactAppResponse,FastAPIAppResponse,FastAPIRootMiddlewareResponse) and re-exports them fromairflow.plugins_managerso plugin authors can annotate their dict literals.What's typed
ExternalViewDict— mirrorsExternalViewResponse.ReactAppDict— mirrorsReactAppResponse.FastAPIAppDict— mirrorsFastAPIAppResponse.FastAPIRootMiddlewareDict— mirrorsFastAPIRootMiddlewareResponse._BaseUIDictfactors the common UI fields (name,icon,icon_dark_mode,url_route,category,nav_top_level).BaseDestinationLiteralfactors thedestinationvalues shared betweenExternalViewDictandReactAppDict;ReactAppDictextends it with"dashboard","dag_overview","task_overview".macrosis narrowed fromlist[Any]tolist[Callable[..., Any]]._get_ui_plugins()return type is narrowed fromtuple[list[Any], list[Any]]totuple[list[ExternalViewDict], list[ReactAppDict]].What's left as
list[Any]flask_blueprints— plugins passflask.Blueprintinstances, not dicts.admin_views,menu_links— legacy Flask-Admin.appbuilder_views,appbuilder_menu_items— deprecated in the API response in favor ofexternal_views.operator_extra_links,global_operator_extra_links,listeners,timetables,windows,partition_mappers,deadline_references,hook_lineage_readers,priority_weight_strategies— class instances, not dict-shaped.Provider updates
common.ai(HITL Review) andedge3pick up the newFastAPIAppDict/ReactAppDicttypes underTYPE_CHECKINGguards — no runtime cost.Backwards compatibility
Runtime behavior is unchanged —
TypedDictis a plaindict, so every existing plugin continues to load and render as before. The changes are type-only.Plugin authors running
mypywill now see errors for missing required fields, misspelled keys, ordestinationvalues outside the documented set.closes: #62222
Was generative AI tooling used to co-author this PR?
Generated-by: gpt-5.5 and Claude Opus 4.7 following the guidelines