OscarLigthart commented on code in PR #63484:
URL: https://github.com/apache/airflow/pull/63484#discussion_r3019109743


##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/task_instances.py:
##########
@@ -82,10 +91,30 @@ class TaskInstanceResponse(BaseModel):
     dag_version: DagVersionResponse | None
 
 
+def _task_instance_discriminator(v: Any) -> str:
+    """Discriminate between TaskInstanceResponse and NewTaskResponse in the 
union."""

Review Comment:
   I don't like this addition, but I needed it to make the Union work with 
Pydantic for allowing the TaskInstance and NewTask into the 
TaskInstanceCollection.
   
   Open to other suggestions, considering also to initialize empty 
TaskInstances.



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