apache/airflow

More thorough type hinting for `AirflowPlugin` attributes

开放

#62,222 创建于 2026年2月20日

 (10 条评论) (0 个反应) (0 位负责人)Python (16,781 个派生)batch import
area:corearea:pluginsgood first issuekind:feature

仓库指标

星标
 (44,809 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Description

Add full type hints and per-field validations for all AirflowPlugin attributes which are non-primitive types (dicts, lists, list of dicts, etc.) to improve IDE support and code self-documentation.

More concretely, define attributes like external_views as their own strongly typed classes with field validations (possibly as Pydantic models, or dataclasses). There are some reasonable examples of what this might look like in the API response models for the plugins FastAPI routes.

Use case/motivation

Currently, many of the AirflowPlugin attributes are some combination of dictionaries or lists of dictionaries, but with little to no type hints for the expected dictionary keys / values. For example, external_views is a list of dicts, but the only information on valid configurations for it are the brief plugin docs code comments.

As such, it is easy to misconfigure these attributes, leading to uncaught user bugs. This also could reduce some of the documentation maintenance burden for these config attributes.

Related issues

None that I was able to find.

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

贡献者指南