Dynamic mapped tasks group arguments are interpreted as MappedArgument when provided to classic operators #40728
Replies: 15 comments 3 replies
-
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval. |
Beta Was this translation helpful? Give feedback.
-
@florian-guily Would you like to be assigned to this issue? |
Beta Was this translation helpful? Give feedback.
-
I'd like to yes, i'll find the time to resolve it ! |
Beta Was this translation helpful? Give feedback.
-
Hello there, I've just encountered the same issue.
I have the version 2.6.3 though. |
Beta Was this translation helpful? Give feedback.
-
Interesting, not anything in a task group though, as python operator created with taskflow api seems to work well. Haven't tried with classic python operator. |
Beta Was this translation helpful? Give feedback.
-
Yes, sorry. I meant while using dynamic task mapping. Like the original post.
|
Beta Was this translation helpful? Give feedback.
-
Noticing this issue as well, tested a task group with task flow API and the arguments get picked up properly, but when passed to traditional operators they don't get picked up properly. |
Beta Was this translation helpful? Give feedback.
-
More examples: |
Beta Was this translation helpful? Give feedback.
-
wondering if there is a known work-around in the mean time? or an update on this? @florian-guily ? |
Beta Was this translation helpful? Give feedback.
-
didn't find a proper workaround to use non-taskflow operators so i just used python operator for everything. I'm investigating on the fix but i'm fairly new to open source contribution so i'm a bit slow, i need to find time for that also. |
Beta Was this translation helpful? Give feedback.
-
The only workaround would be to use taskflow or not use mapped argument IMO |
Beta Was this translation helpful? Give feedback.
-
Yes. And you can use simply Python subprocess.* calls to run bash script in such taskflow-decorated method, there is no particular need to use BashOperator for that if you can just run bash command yourself. |
Beta Was this translation helpful? Give feedback.
-
Converting it to a discussion - as it is unlikely to be an "airflow issue" |
Beta Was this translation helpful? Give feedback.
-
Hello, |
Beta Was this translation helpful? Give feedback.
-
Not sure converting the issue to a discussion was warranted - I believe this is a legitimate issue. |
Beta Was this translation helpful? Give feedback.
-
Apache Airflow version
Other Airflow 2 version (please specify below)
If "Other Airflow 2 version" selected, which one?
2.8.4
What happened?
When using expand_kwargs on a task group, arguments of this task group will not get correctly interpreted when using them in classic operators inside this task group. They will be interpreted as MappedArgument instead of their real values.
What you think should happen instead?
Real value of the mapped task group's argument should be passed to the operators.
How to reproduce
This was originally done with a google cloud operator in a task group, but i managed to reproduce it with a bash operator.
Here are the associated logs. You can clearly see that multiple MappedArguments are passed in the echo command, which should not happen.
dag_id=airflow_issue_test_run_id=scheduled__2024-04-14T00_00_00+00_00_task_id=bq_to_gcs_tg.bash_task_map_index=0_attempt=2.log
Operating System
Mac OS Sonoma 14.2.1 (23C71)
Versions of Apache Airflow Providers
apache-airflow-providers-google==10.16.0
apache-airflow-providers-common-sql>=1.11.0
Deployment
Docker-Compose
Deployment details
No response
Anything else?
No response
Are you willing to submit PR?
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions