fbertos opened a new issue #19103:
URL: https://github.com/apache/airflow/issues/19103
### Description
Hi,
In order to avoid extra calls to the REST API to figure out the dag_run_id
linked to a task instance, it would be great to have that information in the
response of the following methods of the REST API:
- /api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances
- /api/v1/dags/~/dagRuns/~/taskInstances/list
The current response returns a list of task instances without the dag_run_id:
{
"task_instances": [
{
"task_id": "string",
"dag_id": "string",
"execution_date": "string",
"start_date": "string",
"end_date": "string",
"duration": 0,
"state": "success",
"try_number": 0,
"max_tries": 0,
"hostname": "string",
"unixname": "string",
"pool": "string",
"pool_slots": 0,
"queue": "string",
"priority_weight": 0,
"operator": "string",
"queued_when": "string",
"pid": 0,
"executor_config": "string",
"sla_miss": {
"task_id": "string",
"dag_id": "string",
"execution_date": "string",
"email_sent": true,
"timestamp": "string",
"description": "string",
"notification_sent": true
}
}
],
"total_entries": 0
}
Our proposal is to add the dag_run_id in the response:
{
"task_instances": [
{
"task_id": "string",
"dag_id": "string",
"execution_date": "string",
**"dag_run_id": "string",**
"start_date": "string",
"end_date": "string",
"duration": 0,
"state": "success",
"try_number": 0,
"max_tries": 0,
"hostname": "string",
"unixname": "string",
"pool": "string",
"pool_slots": 0,
"queue": "string",
"priority_weight": 0,
"operator": "string",
"queued_when": "string",
"pid": 0,
"executor_config": "string",
"sla_miss": {
"task_id": "string",
"dag_id": "string",
"execution_date": "string",
"email_sent": true,
"timestamp": "string",
"description": "string",
"notification_sent": true
}
}
],
"total_entries": 0
}
Thanks!
### Use case/motivation
Having tthe dag_run_id when we get a list of task instances.
### Related issues
_No response_
### Are you willing to submit a PR?
- [ ] 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]