- Notifications
You must be signed in to change notification settings - Fork 16.2k
Do not ignore include_prior_dates in xcom_pull when map_indexes is not specified #53809
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
kaxil reviewed Jul 28, 2025
kaxil reviewed Jul 28, 2025
kaxil approved these changes Jul 28, 2025
uranusjr approved these changes Jul 28, 2025
Backport failed to create: v3-0-test. View the failure log Run details
You can attempt to backport this manually by running: cherry_picker 2a2d3e1 v3-0-testThis should apply the commit to the v3-0-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continue |
Contributor Author
| This likely needs multiple other PRs to be cherry picked |
RoyLee1224 pushed a commit to RoyLee1224/airflow that referenced this pull request Jul 31, 2025
ferruzzi pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Aug 7, 2025
amoghrajesh added a commit to astronomer/airflow that referenced this pull request Aug 11, 2025
…s not specified (apache#53809) (cherry picked from commit 2a2d3e1)
fweilun pushed a commit to fweilun/airflow that referenced this pull request Aug 11, 2025
amoghrajesh added a commit to astronomer/airflow that referenced this pull request Aug 11, 2025
…s not specified (apache#53809) (cherry picked from commit 2a2d3e1)
amoghrajesh added a commit to astronomer/airflow that referenced this pull request Aug 11, 2025
…s not specified (apache#53809) (cherry picked from commit 2a2d3e1)
amoghrajesh added a commit to astronomer/airflow that referenced this pull request Aug 11, 2025
…s not specified (apache#53809) (cherry picked from commit 2a2d3e1)
This was referenced Aug 13, 2025
Closed
2 tasks
kaxil added a commit to astronomer/airflow that referenced this pull request Aug 22, 2025
Extend `AddIncludePriorDatesToGetXComSlice` version change to include `GetXcomFilterParams` in addition to `GetXComSliceFilterParams`. This ensures that the include_prior_dates field is properly handled in API version migrations for both XCom endpoints: - GET /xcoms/{dag_id}/{run_id}/{task_id}/{key} (single XCom) - GET /xcoms/{dag_id}/{run_id}/{task_id}/{key}/slice (XCom slice) This was missed in apache#53809 kaxil added a commit to astronomer/airflow that referenced this pull request Aug 22, 2025
Extend `AddIncludePriorDatesToGetXComSlice` version change to include `GetXcomFilterParams` in addition to `GetXComSliceFilterParams`. This ensures that the include_prior_dates field is properly handled in API version migrations for both XCom endpoints: - GET /xcoms/{dag_id}/{run_id}/{task_id}/{key} (single XCom) - GET /xcoms/{dag_id}/{run_id}/{task_id}/{key}/slice (XCom slice) This was missed in apache#53809 kaxil added a commit that referenced this pull request Aug 22, 2025
Extend `AddIncludePriorDatesToGetXComSlice` version change to include `GetXcomFilterParams` in addition to `GetXComSliceFilterParams`. This ensures that the include_prior_dates field is properly handled in API version migrations for both XCom endpoints: - GET /xcoms/{dag_id}/{run_id}/{task_id}/{key} (single XCom) - GET /xcoms/{dag_id}/{run_id}/{task_id}/{key}/slice (XCom slice) This was missed in #53809 mangal-vairalkar pushed a commit to mangal-vairalkar/airflow that referenced this pull request Aug 30, 2025
Extend `AddIncludePriorDatesToGetXComSlice` version change to include `GetXcomFilterParams` in addition to `GetXComSliceFilterParams`. This ensures that the include_prior_dates field is properly handled in API version migrations for both XCom endpoints: - GET /xcoms/{dag_id}/{run_id}/{task_id}/{key} (single XCom) - GET /xcoms/{dag_id}/{run_id}/{task_id}/{key}/slice (XCom slice) This was missed in apache#53809 kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Oct 24, 2025
Extend `AddIncludePriorDatesToGetXComSlice` version change to include `GetXcomFilterParams` in addition to `GetXComSliceFilterParams`. This ensures that the include_prior_dates field is properly handled in API version migrations for both XCom endpoints: - GET /xcoms/{dag_id}/{run_id}/{task_id}/{key} (single XCom) - GET /xcoms/{dag_id}/{run_id}/{task_id}/{key}/slice (XCom slice) This was missed in apache/airflow#53809 GitOrigin-RevId: 2821393915ddec40b074ebf437014e3f773093c1 2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:API Airflow's REST/HTTP API area:task-sdk backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
closes: #53593
Problem
The
include_prior_dates parameterin xcom_pull() was being completely ignored when map_indexes was not explicitly specified (default NOTSET case). This caused XComs from previous DAG runs to not be retrieved even when include_prior_dates=True was passed.Example:
Expected behavior: 2nd run should print "XCom pulled. Value: - xcom value -"
Why?
After #51568, the
xcom_pull()method has with two code paths:After introducing path 1, there could be cases when
include_prior_datesis passed but XCom.get_all path is chosen, which ignores that parameter entirely.The bug occurred because:
XCom.get_all() didn't support the include_prior_dates parameter
The first path was always chosen when map_indexes wasn't specified
include_prior_dates was silently ignored and never passed through the communication chain
Solution
Extended the first path to support include_prior_dates by threading the parameter through the entire communication chain:
Testing
DAG:
Min repro dag from the issue:
Before
Run 1:
Run 2 and later:

After
Run 1:
Run 2:
Run 3:
No Cadywn migration needed - This is a backward compatible API change with change only in parameters and no request / response models have changed.
^ 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.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.