zach-overflow opened a new issue, #62222:
URL: https://github.com/apache/airflow/issues/62222

   ### Description
   
   Add full type hints and per-field validations for all `AirflowPlugin` 
attributes which are non-primitive types (dicts, lists, list of dicts) 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 
data classes). 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 or 
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?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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