cb149 opened a new issue #19078:
URL: https://github.com/apache/airflow/issues/19078


   ### Apache Airflow version
   
   2.2.0 (latest released)
   
   ### Operating System
   
   Ubuntu
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   Just used `airflow standalone`
   
   ### What happened
   
   First:
   
   TaskGroup does not show the tooltip that is defined for that group on hover
   
![2021-10-19_17h00_18](https://user-images.githubusercontent.com/35238779/137937706-376922b8-2f79-47ac-9789-6007d135f855.png)
   
   Second:
   
   Providing an Operator with `task_group=` instead of TaskGroup as context 
manager ignores that TaskGroup's default_args. Using the code I provided below, 
the task "end" in section_3 has the wrong owner.
   
   
   ### What you expected to happen
   
   First:
   
   If a TaskGroup is used and the tooltip is defined like so:
   ```python
   with TaskGroup("section_1", tooltip="Tasks for section_1") as section_1:
   ```
   the information provided with`tooltip="..."` should show on hover, as shown 
in the official documentation at 
https://airflow.apache.org/docs/apache-airflow/stable/concepts/dags.html#taskgroups
   
   
   Second:
   
   Defining a TaskGroup with default_args like
   ```python
   section_3 = TaskGroup("section_3", tooltip="Tasks for section_2", 
default_args={"owner": "bug"})
   ```
   should result in those default_args being used by tasks defined like so:
   ```python
   end = DummyOperator(task_id="end", task_group=section_3)
   ```
   
   ### How to reproduce
   
   I have tested this with the below code
   
   ```python
   from datetime import datetime
   
   from airflow.models.dag import DAG
   from airflow.operators.bash import BashOperator
   from airflow.operators.dummy import DummyOperator
   from airflow.utils.task_group import TaskGroup
   
   with DAG(
       dag_id="task_group_test",
       start_date=datetime(2021, 1, 1),
       catchup=False,
       tags=["example"],
       default_args={"owner": "test"},
   ) as dag:
       start = DummyOperator(task_id="start")
   
       with TaskGroup("section_1", tooltip="Tasks for section_1") as section_1:
           task_1 = DummyOperator(task_id="task_1")
           task_2 = BashOperator(task_id="task_2", bash_command="echo 1")
           task_3 = DummyOperator(task_id="task_3")
   
           task_1 >> [task_2, task_3]
   
       with TaskGroup(
           "section_2", tooltip="Tasks for section_2", default_args={"owner": 
"overwrite"}
       ) as section_2:
           task_1 = DummyOperator(task_id="task_1")
   
       section_3 = TaskGroup("section_3", tooltip="Tasks for section_3", 
default_args={"owner": "bug"})
   
       end = DummyOperator(task_id="end", task_group=section_3)
   
       start >> section_1 >> section_2 >> section_3
   ```
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to