pierrejeambrun commented on code in PR #63716:
URL: https://github.com/apache/airflow/pull/63716#discussion_r2940978381


##########
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:
   Main implementation isn't working with `2.12.0`. It broke main and that's 
why we had to bump pydantic in #63570.
   
   Since this forces a quite new pydantic version, I figured we should try to 
fix it for older pydantic version so we don't have that aggressive bump.
   
   But apparently it's not working well :(.



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