-
Notifications
You must be signed in to change notification settings - Fork 16.8k
Description
Apache Airflow version
main (development)
What happened
When mapped, classic operator tasks exist within TaskGroups, the group_id of the TaskGroup is prepended to the displayed task_id in the Graph View.
In the below screenshot, all displayed task IDs only contain the direct task_id except for the "mapped_classic_task". This particular task is a mapped BashOperator task. The prepended group_id does not appear for unmapped, classic operator tasks, nor mapped and unmapped TaskFlow tasks.
What you think should happen instead
The pattern of the displayed task names should be consistent for all task types (mapped/unmapped, classic operators/TaskFlow functions). Additionally, having the group_id prepended to the mapped, classic operator tasks is a little redundant and less readable.
How to reproduce
- Use an example DAG of the following:
from pendulum import datetime
from airflow.decorators import dag, task, task_group
from airflow.operators.bash import BashOperator
@dag(start_date=datetime(2022, 1, 1), schedule_interval=None)
def task_group_task_graph():
@task_group
def my_task_group():
BashOperator(task_id="not_mapped_classic_task", bash_command="echo")
BashOperator.partial(task_id="mapped_classic_task").expand(
bash_command=["echo", "echo hello", "echo world"]
)
@task
def another_task(input=None):
...
another_task.override(task_id="not_mapped_taskflow_task")()
another_task.override(task_id="mapped_taskflow_task").expand(input=[1, 2, 3])
my_task_group()
_ = task_group_task_graph()- Navigate to the Graph view
- Notice that the
task_idfor the "mapped_classic_task" prepends the TaskGroupgroup_idof "my_task_group" while the other tasks in the TaskGroup do not.
Operating System
Debian GNU/Linux
Versions of Apache Airflow Providers
N/A
Deployment
Other
Deployment details
Breeze
Anything else
Setting prefix_group_id=False for the TaskGroup does remove the prepended group_id from the tasks display name.
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
