KushagraB424 opened a new issue, #69921:
URL: https://github.com/apache/airflow/issues/69921
### Under which category would you file this issue?
Airflow Core
### Apache Airflow version
main
### What happened and how to reproduce it?
Currently, when a task instance starts via the new Task SDK, the Execution
API's `ti_run` endpoint returns empty lists for `variables` and `connections`
in the `TIRunContext` payload.
In `airflow/api_fastapi/execution_api/routes/task_instances.py` (around line
306), there is a hardcoded placeholder and a `TODO` comment:
```python
context = TIRunContext(
dag_run=dr,
task_reschedule_count=task_reschedule_count,
max_tries=ti.max_tries,
# TODO: Add variables and connections that are needed (and has
perms) for the task
variables=[],
connections=[],
# ...
)
```
Because these are not populated, the Task SDK does not receive the
pre-fetched connections and variables it needs up front during initialization.
Steps to reproduce:
Run a task using the new Airflow 3.0 Task SDK / Execution API.
Observe the network payload returned by the ti_run endpoint (or inspect the
TIRunContext in the supervisor/task runner).
The variables and connections arrays are always empty [].
### What you think should happen instead?
The Execution API should inspect the task's requirements (e.g., via template
fields or explicitly declared dependencies), verify that the task has the
necessary permissions, fetch the corresponding variables and connections from
the database/secrets backend, and include them in the `TIRunContext` payload
returned to the Task SDK.
### 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]