-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Open
Labels
area:loggingarea:task-execution-interface-aip72AIP-72: Task Execution Interface (TEI) aka Task SDKAIP-72: Task Execution Interface (TEI) aka Task SDK
Milestone
Description
Resurrect #45927 and extend it.
Every request should have a response that the client reads.
We need the ability to pass/send errors from Supervisor to the task code (for instance if there is an error performing an action, or if the XCom can't be found) -- right now each end point handles this itself in a different way.
airflow/task_sdk/src/airflow/sdk/api/client.py
Lines 267 to 282 in eb05869
| except ServerResponseError as e: | |
| if e.response.status_code == HTTPStatus.NOT_FOUND: | |
| log.error( | |
| "XCom not found", | |
| dag_id=dag_id, | |
| run_id=run_id, | |
| task_id=task_id, | |
| key=key, | |
| map_index=map_index, | |
| detail=e.detail, | |
| status_code=e.response.status_code, | |
| ) | |
| # Airflow 2.x just ignores the absence of an XCom and moves on with a return value of None | |
| # Hence returning with key as `key` and value as `None`, so that the message is sent back to task runner | |
| # and the default value of None in xcom_pull is used. | |
| return XComResponse(key=key, value=None) |
Metadata
Metadata
Assignees
Labels
area:loggingarea:task-execution-interface-aip72AIP-72: Task Execution Interface (TEI) aka Task SDKAIP-72: Task Execution Interface (TEI) aka Task SDK
Type
Projects
Status
Icebox