Fixed Task group names duplication in Task's task_id for MappedOperator#53532
Fixed Task group names duplication in Task's task_id for MappedOperator#53532Lee-W merged 4 commits intoapache:mainfrom
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
|
@Lee-W , please, have a look |
c2e3f28 to
d9b3ea3
Compare
Co-authored-by: Wei Lee <[email protected]>
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Backport failed to create: v3-0-test. View the failure log Run details
You can attempt to backport this manually by running: cherry_picker 6b618ef v3-0-testThis should apply the commit to the v3-0-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continue |
…or (apache#53532) Co-authored-by: Wei Lee <[email protected]> Co-authored-by: Evgenii Prusov <[email protected]> (cherry picked from commit 6b618ef)
…or (apache#53532) Co-authored-by: Wei Lee <[email protected]> Co-authored-by: Evgenii Prusov <[email protected]> (cherry picked from commit 6b618ef)
…or (apache#53532) Co-authored-by: Wei Lee <[email protected]> Co-authored-by: Evgenii Prusov <[email protected]> (cherry picked from commit 6b618ef)
…or (#53532) Co-authored-by: Wei Lee <[email protected]> Co-authored-by: Evgenii Prusov <[email protected]> (cherry picked from commit 6b618ef)
…or (apache#53532) Co-authored-by: Wei Lee <[email protected]> Co-authored-by: Evgenii Prusov <[email protected]> (cherry picked from commit 6b618ef)
Summary
Fixes task_id duplication when unmapping a MappedOperator within a TaskGroup. Previously, task IDs would get double-prefixed (e.g.,
tg1.tg1.mapped_taskinstead oftg1.mapped_task).Problem
When
MappedOperator.unmap()is called, it passes the already-prefixed task_id toBaseOperator.__init__, which applies the prefix again viatask_group.child_id().closes: #52334
Solution
Check if task_id already contains the task group prefix before passing to BaseOperator, preventing double prefixing.
Testing
Added test
test_mapped_operator_in_task_group_no_duplicate_prefixto verify the fix. All existing tests pass.