pierrejeambrun commented on code in PR #63716:
URL: https://github.com/apache/airflow/pull/63716#discussion_r2945551907
##########
airflow-core/src/airflow/api_fastapi/core_api/base.py:
##########
@@ -54,12 +54,12 @@ def make_partial_model(model: type[PydanticBaseModel]) ->
type[PydanticBaseModel
"""Create a version of a Pydantic model where all fields are Optional with
default=None."""
field_overrides: dict = {}
for field_name, field_info in model.model_fields.items():
- new_info = deepcopy(field_info)
ann = field_info.annotation
origin = get_origin(ann)
if not (origin is Union and type(None) in get_args(ann)):
ann = ann | None # type: ignore[operator, assignment]
- new_info.default = None
+ new_info = FieldInfo(default=None)
Review Comment:
Done, and manually reverted the bump on the last commit. Lets see what the
CI says.
--
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]