-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Fix rendering the mapped parameters when using expand_kwargs
method
#32272
Fix rendering the mapped parameters when using expand_kwargs
method
#32272
Conversation
Signed-off-by: Hussein Awala <[email protected]>
I have tested this with a testing DAG and confirmed that it works as expected. However, before removing the |
Tests disagree 🙂
|
… to resolve the xcom data or not
990d00f
to
14bd392
Compare
@uranusjr According to the failed test, we should use the XCom data as it is without resolving it via Jinja. In this case, we cannot consider the reported issue as a bug, because the task result is shared using XCom, and not resolving this result is an expected behavior. However, supporting passing templates via XCom especially for the mapped operator is a nice feature IMO, for that, I propose adding a new parameter WDYT? |
Isn’t the original issue about passing a template as a string literal? That sounds like a reasonable thing, and doesn’t involve XCom. |
@uranusjr, I discovered that the issue is just related to the Could you take another look? For the new feature "template_in_template" I proposed, I will open a new PR to discuss its idea. |
expand_kwargs
method
…#32272) * Fix rendering the mapped parameters in the mapped operator Signed-off-by: Hussein Awala <[email protected]> * add template_in_template arg to expand method to tell Airflow whether to resolve the xcom data or not * fix dag serialization tests * Revert "fix dag serialization tests" This reverts commit 191351c. * Revert "add template_in_template arg to expand method to tell Airflow whether to resolve the xcom data or not" This reverts commit 14bd392. * Fix ListOfDictsExpandInput resolve method * remove _iter_parse_time_resolved_kwargs method * remove unnecessary step --------- Signed-off-by: Hussein Awala <[email protected]> (cherry picked from commit d1e6a5c)
closes: #32260
This PR fixes a bug in the mapped operator when using expand_kwargs method.
In the
ListOfDictsExpandInput
class, the resolve method doesn't filter out string values from theresolved_oids
list as we do in the classDictOfListsExpandInput
. Consequently, these strings are incorrectly regarded as resolved, even though they are not instances fromMappedArgument
orXComArg
, and their values still match those provided by the user.This PR removes the literal str values from the list
resolved_oids
to let the BaseOperator class resolve them.^ 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.