Skip to content

Consider mapped upstream in TriggerRuleDep - #22583

Merged
uranusjr merged 2 commits into
apache:mainfrom
astronomer:mapped-task-reduce-downstream
Apr 6, 2022
Merged

uranusjr merged 2 commits into
apache:mainfrom
astronomer:mapped-task-reduce-downstream

Conversation

@uranusjr

@uranusjr uranusjr commented Mar 29, 2022 •

Copy link
Copy Markdown
Member

This is needed to ensure all mapped upstream task instances are depended on by a downstream, instead of just one of them signifying the entire task as "done".

Does not work yet. This depends on correct task-unmapping behaviour implemented in #22396. I also want to add some more asserts to make sure the downstream can pull all the values from the mapped upstream, but that depends on #22609. Ready!

Comment thread airflow/models/mappedoperator.py Resolved
@uranusjr
uranusjr force-pushed the mapped-task-reduce-downstream branch 5 times, most recently from 28ec197 to 85ab997 Compare March 30, 2022 17:49
Comment thread airflow/models/taskinstance.py Outdated
Comment on lines 822 to 846

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Somewhat surprising we didn’t catch this earlier!

@uranusjr
uranusjr marked this pull request as ready for review March 30, 2022 17:50
@uranusjr
uranusjr requested review from XD-DENG and kaxil as code owners March 30, 2022 17:50
Comment thread airflow/models/taskinstance.py Resolved
Comment thread airflow/models/taskinstance.py Resolved
@uranusjr
uranusjr force-pushed the mapped-task-reduce-downstream branch from 85ab997 to 318367f Compare March 31, 2022 05:58
Comment thread airflow/models/taskinstance.py Resolved
Comment thread airflow/models/taskinstance.py Outdated

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.

this reminds me... thinking about custom xcom backends ... there should be a probably be a "clear data" hook that can be implemented in an xcom backend to purge the external data without having to override this method... of course that's another PR

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is XCom.clear() not enough?

@uranusjr
uranusjr force-pushed the mapped-task-reduce-downstream branch from 10d712a to 2b4d9a2 Compare April 1, 2022 06:47
@uranusjr
uranusjr force-pushed the mapped-task-reduce-downstream branch from 2b4d9a2 to 6a9f8bd Compare April 1, 2022 10:11
@github-actions

github-actions Bot commented Apr 1, 2022

Copy link
Copy Markdown
Contributor

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions Bot added the full tests needed We need to run full set of tests for this PR to merge label Apr 1, 2022
uranusjr added 2 commits April 4, 2022 20:31
This is needed to ensure all mapped upstream task instances are depended
on by a downstream, instead of just one of them signifying the entire
task as "done".
We catually missed quite several things for this to happen! Most namely
the pre-execution XCom clearing behavior; that's surprising. But things
should work now.
@uranusjr
uranusjr force-pushed the mapped-task-reduce-downstream branch from 6a9f8bd to 5a62d56 Compare April 4, 2022 12:31
@uranusjr
uranusjr merged commit 2795650 into apache:main Apr 6, 2022
@uranusjr
uranusjr deleted the mapped-task-reduce-downstream branch April 6, 2022 06:27
@ephraimbuddy ephraimbuddy added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Apr 8, 2022
@jedcunningham jedcunningham added this to the Airflow 2.3.0 milestone Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dynamic-task-mapping AIP-42 changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) full tests needed We need to run full set of tests for this PR to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants