Skip to content

AIP-72: Pass context keys from API Server to Workers - #44899

Merged
kaxil merged 1 commit into
apache:mainfrom
astronomer:task-context-api-server
Dec 16, 2024
Merged

AIP-72: Pass context keys from API Server to Workers#44899
kaxil merged 1 commit into
apache:mainfrom
astronomer:task-context-api-server

Conversation

@kaxil

@kaxilkaxil commented Dec 12, 2024

Copy link
Copy Markdown
Member

Part of #44481

This commit augments the TI context available in the Task Execution Interface with the one from the Execution API Server.

In future PRs the following will be added:

  • More methods on TI like ti.xcom_pull, ti.xcom_push etc
  • Lazy fetching of connections, variables
  • Verifying the "get_current_context" is working
    f3ea195

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@kaxil
kaxilforce-pushed the task-context-api-server branch 2 times, most recently from c751760 to ef7be4cCompareDecember 13, 2024 12:00

@ashbashb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah looks like a good approach

Comment threadairflow/api_fastapi/execution_api/datamodels/taskinstance.py
Comment threadairflow/api_fastapi/execution_api/datamodels/taskinstance.py
Comment threadairflow/api_fastapi/execution_api/routes/task_instances.py
Comment threadtask_sdk/src/airflow/sdk/execution_time/task_runner.py
Comment threadtask_sdk/src/airflow/sdk/execution_time/task_runner.py
@kaxil
kaxilforce-pushed the task-context-api-server branch 5 times, most recently from 2170af7 to f3ea195CompareDecember 16, 2024 11:25
@kaxil
kaxil marked this pull request as ready for review December 16, 2024 11:26
Comment threadairflow/api_fastapi/execution_api/routes/task_instances.py
Comment threadairflow/api_fastapi/execution_api/routes/task_instances.py Outdated
Comment threadtask_sdk/src/airflow/sdk/execution_time/comms.py Outdated
Comment threadtask_sdk/src/airflow/sdk/execution_time/task_runner.py Outdated
Comment threadtask_sdk/tests/conftest.py
Comment threadtask_sdk/tests/execution_time/test_task_runner.py Outdated
Comment threadtask_sdk/tests/execution_time/test_task_runner.py Outdated

@ashbashb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nits/questions in comments to address, but LGTM

@amoghrajeshamoghrajesh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks generally good, few comments/qns

Comment threadairflow/api_fastapi/execution_api/datamodels/taskinstance.py
Comment threadairflow/api_fastapi/execution_api/routes/task_instances.py
Comment threadairflow/api_fastapi/execution_api/routes/task_instances.py
Comment threadairflow/api_fastapi/execution_api/routes/task_instances.py
Comment threadairflow/api_fastapi/execution_api/routes/task_instances.py Outdated
Comment threadtask_sdk/tests/execution_time/test_task_runner.py Outdated
Part of apache#44481
This commit augments the TI context available in the Task Execution Interface with the one from the Execution API Server.
In future PRs the following will be added:
- More methods on TI like ti.xcom_pull, ti.xcom_push etc
- Lazy fetching of connections, variables
- Verifying the "get_current_context" is working
@kaxil
kaxilforce-pushed the task-context-api-server branch from f3ea195 to 06ae46dCompareDecember 16, 2024 15:28
@kaxil
kaxil merged commit dbff6e3 into apache:mainDec 16, 2024
@kaxil
kaxil deleted the task-context-api-server branch December 16, 2024 16:11
got686-yandex pushed a commit to got686-yandex/airflow that referenced this pull request Jan 30, 2025
Part of apache#44481
This commit augments the TI context available in the Task Execution Interface with the one from the Execution API Server.
In future PRs the following will be added:
- More methods on TI like ti.xcom_pull, ti.xcom_push etc
- Lazy fetching of connections, variables
- Verifying the "get_current_context" is working
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

3 participants

@kaxil@ashb@amoghrajesh