Skip to content

Conversation

@uranusjr
Copy link
Member

@uranusjr uranusjr commented Jul 15, 2022

This is done by adding a variant to the XComArg mechanism so we can hook extra logic into resolve() at runtime.

Some extra mechanism is added so we can continue to use XComArg like we do right now, but also prevent TransformedXComArg from needing to inherit a lot of the old XComArg nonsense like __str__ and __getitem__.

Some validation is removed from the upstream that pushed the XCom, because with map() we can no longer be sure the XCom is “wrong” when the upstream finishes (we can only know in the downstream, after transform functions are applied).

@uranusjr uranusjr force-pushed the aip-42-xcom-arg-map branch 2 times, most recently from 291baa5 to 26982ab Compare July 18, 2022 10:32
@uranusjr uranusjr marked this pull request as ready for review July 18, 2022 10:34
@potiuk
Copy link
Member

potiuk commented Jul 21, 2022

I don't know too much on the details to have useful review, but if you need my review @uranusjr I can dig a bit deeper if other's won't chime in.

@uranusjr
Copy link
Member Author

Feel free! This one on its own shouldn’t need too much context to understand.

uranusjr added 3 commits July 22, 2022 14:32
After implementing map(), the upstream of expand_kwargs() does not
necessarily need to push a list of dicts, but a sequence of anything
(and can rely on map() to convert elements to dicts). So we need to
relax the restriction. If the map() function returns a non-dict,
unmapping would fail anyway.
Some extra mechanism is added so we can continue to use XComArg like we
do right now, but also prevent TransformedXComArg from needing to
inherit a lot of the old XComArg nonsense like __str__ and __getitem__.
@uranusjr uranusjr force-pushed the aip-42-xcom-arg-map branch from 26982ab to 28a06e4 Compare July 22, 2022 06:32
@uranusjr uranusjr merged commit 877dc89 into apache:main Jul 25, 2022
@uranusjr uranusjr deleted the aip-42-xcom-arg-map branch July 25, 2022 03:41
@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

Labels

area:dynamic-task-mapping AIP-42 type:new-feature Changelog: New Features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants