-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create XCom API #46042
base: main
Are you sure you want to change the base?
Create XCom API #46042
Conversation
schema: | ||
$ref: '#/components/schemas/HTTPExceptionResponse' | ||
description: Bad Request | ||
'404': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 404 response code for the POST API seems unconventional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
404 here seems to be ok, given dag_id does not exist
Just adding comments as copy of the 1:1 conversation: I would understand if the API can be used to "patch" wrong/incorrect XCom values administratively for specific szenarios where upstream tasks can not be re-executed but values are incorrect. But the PR of this API is only adding XCom, will raise an error if the value is existing. So before merging I'd propose to have a bit of discussion between the other maintainers if we want to open XCom up to external applications to signal a processing status. If so then this integration pattern would require a bit of documentation as well. |
This is not the use case. The use case is incident recovery. When on call fixes problems with data pipeline manual interventions sometimes required. |
related: #45966
The XCom creation API fills a critical gap by enabling dynamic, external updates to workflows. This PR solves that problem.
Benefits:
Steps to play around the feature.
This Airflow DAG demonstrates how to use XComs for passing data between tasks. The first task (wait_and_not_push) waits for 1 minute but does not push any XCom. The second task (pull_and_print) attempts to pull an XCom value with the key outbound_key1 from the first task, logs it if found, or warns if absent.
Now, check the logs, You can see the XCom pull was successful.
^ 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.