Skip to content
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

Implement XComArg.zip(*xcom_args) #25176

Merged
merged 2 commits into from
Aug 1, 2022
Merged

Conversation

uranusjr
Copy link
Member

@uranusjr uranusjr commented Jul 20, 2022

This needs #25085 to be merged first.

Currently submitted for CI so I know I’ve made the right refactoring…

This is mostly done. If #25173 is merged first, I want to also add zip() to the type hint stub. If this is merged before #25173, we can add the hint with a new PR later. Done

There are two parts in this PR. The first part (commit) refactors XComArg to make it naturally reference multiple XComs, instead of just one key in one operator. This also involves some changes in abstraction is task mapping and serialisation. The second commit actually implements zip(), and is relatively simple since all the foundation has been layed in the refactoring part.

@uranusjr uranusjr force-pushed the aip-42-xcom-arg-zip branch 8 times, most recently from 1b9d0b9 to dba1d6c Compare July 25, 2022 10:35
@uranusjr uranusjr marked this pull request as ready for review July 26, 2022 07:12
@uranusjr uranusjr requested review from kaxil, ashb and XD-DENG as code owners July 26, 2022 07:12
airflow/serialization/serialized_objects.py Show resolved Hide resolved
airflow/models/xcom_arg.py Show resolved Hide resolved
airflow/models/xcom_arg.py Show resolved Hide resolved
This will be needed to implementing zip() since zipping means combining
multiple upstream tasks' values into one. All existing implementations
reference one single task right now.
With the foundation layed down, this is relatively straightforward. The
only thing we need to be aware is the make the resolved value
index-able, and thus cannot use the built-in zip() (which returns an
iterator).
@uranusjr uranusjr force-pushed the aip-42-xcom-arg-zip branch from 13bd59e to 98833b9 Compare August 1, 2022 01:55
@uranusjr uranusjr merged commit b90fc14 into apache:main Aug 1, 2022
@uranusjr uranusjr deleted the aip-42-xcom-arg-zip branch August 1, 2022 09:12
@ephraimbuddy ephraimbuddy added the type:new-feature Changelog: New Features label Aug 15, 2022
@ephraimbuddy ephraimbuddy added this to the Airflow 2.4.0 milestone Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants