Chris-OA-AF opened a new issue, #24341:
URL: https://github.com/apache/airflow/issues/24341

   ### Apache Airflow version
   
   2.1.4
   
   ### What happened
   
   As per the [official 
documentation](https://airflow.apache.org/docs/apache-airflow/stable/concepts/dags.html#taskgroups)
 TaskGroups support the use of default_args argument, but the use results in an 
import error:
   
   Broken DAG: [/home/airflow/gcs/dags/test_dag.py] Traceback (most recent call 
last):
     File "<frozen importlib._bootstrap>", line 219, in 
_call_with_frames_removed
     File "/home/airflow/gcs/dags/test_dag.py", line 15, in <module>
       with TaskGroup('group1', default_args={'retries': 3}):
   TypeError: __init__() got an unexpected keyword argument 'default_args'
   
   ### What you think should happen instead
   
   DAG should have been imported without errors and the use of default_args 
should be possible as per the [official 
documentation](https://airflow.apache.org/docs/apache-airflow/stable/concepts/dags.html#taskgroups)
   
   ### How to reproduce
   
   Code is taken from the [official 
documentation](https://airflow.apache.org/docs/apache-airflow/stable/concepts/dags.html#taskgroups)
   
   ```python
   from airflow.models.dag import DAG
   from airflow.operators.bash import BashOperator
   from airflow.operators.dummy import DummyOperator
   from airflow.utils.dates import days_ago
   from airflow.utils.task_group import TaskGroup
   import pendulum
   
   with DAG(
       dag_id='dag_dev_20220609',
       start_date=pendulum.datetime(2022, 1, 1, tz="UTC"),
       schedule_interval="@daily",
       catchup=False,
       default_args={'retries': 1},
   ):
       with TaskGroup('group1', default_args={'retries': 3}):
           task1 = BashOperator(task_id='task1', bash_command='echo Hello 
World! task1')
           task2 = BashOperator(task_id='task2', bash_command='echo Hello 
World! task2', retries=2)
           print(task1.retries) # 3
           print(task2.retries) # 2
   ```
   
   ### Operating System
   
   Google Cloud Composer
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Composer
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   Problem occurs every time
   
   ### 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