KushagraB424 opened a new issue, #69935: URL: https://github.com/apache/airflow/issues/69935
### Under which category would you file this issue? Airflow Core ### Apache Airflow version main ### What happened and how to reproduce it? **Issue Description** In the Task Execution API, the `DagRun` schema (used within `TIRunContext` in `airflow-core/src/airflow/api_fastapi/execution_api/datamodels/taskinstance.py`) contains `dag_id` and `run_id` fields. However, these fields are completely redundant because the worker already has the DAG ID and Run ID natively from the `TaskInstance` context. There is an existing `TODO` comment in the codebase specifically pointing out this duplication: `# TODO: dag_id and run_id are duplicated from TaskInstance` `# See if we can avoid sending these fields from API server and instead` `# use the TaskInstance data to get the DAG run information in the client (Task Execution Interface).` **Steps to reproduce:** Inspect the `DagRun` schema defined in `airflow-core/src/airflow/api_fastapi/execution_api/datamodels/taskinstance.py`. ### What you think should happen instead? We should remove the `dag_id` and `run_id` fields from the `DagRun` model in the API server to streamline the payload. The Task SDK client should be updated to rely on the `TaskInstance` identifiers instead of expecting them to be nested in the `DagRun` payload. I'd be happy to submit a PR to resolve this `TODO`! ### Operating System Not Applicable ### Deployment None ### Apache Airflow Provider(s) _No response_ ### Versions of Apache Airflow Providers Not Applicable ### Official Helm Chart version Not Applicable ### Kubernetes Version Not Applicable ### Helm Chart configuration Not Applicable ### Docker Image customizations Not Applicable ### Anything else? _No response_ ### Are you willing to submit PR? - [x] 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]
