OscarLigthart commented on code in PR #63484:
URL: https://github.com/apache/airflow/pull/63484#discussion_r3018694288
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -281,7 +283,7 @@ def clear_dag_run(
body: DAGRunClearBody,
dag_bag: DagBagDep,
session: SessionDep,
-) -> TaskInstanceCollectionResponse | DAGRunResponse:
+) -> TaskInstanceCollectionResponse | DAGRunResponse |
NewTaskCollectionResponse:
Review Comment:
If I understand correctly, this would be the how we fill the
`TaskInstanceCollectionResponse`:
```
task_instances = [
TaskInstanceResponse(
id=uuid4(),
task_id=task_id,
dag_id=dag_run.dag_id,
dag_run_id=dag_run.run_id,
map_index=-1,
logical_date=None,
run_after=dt.now(timezone.utc),
start_date=None,
end_date=None,
duration=None,
state=None,
try_number=0,
max_tries=0,
task_display_name=task_id,
dag_display_name=dag_run.dag_model.dag_display_name if
dag_run.dag_model else dag_id,
hostname=None,
unixname=None,
pool="default_pool",
pool_slots=1,
queue=None,
priority_weight=None,
operator=None,
operator_name=None,
queued_when=None,
scheduled_when=None,
pid=None,
executor=None,
executor_config="",
note=None,
rendered_map_index=None,
trigger=None,
triggerer_job=None,
dag_version=None,
)
for task_id in sorted(task_instances_or_ids)
]
```
Which looks wrong.
--
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]