penggongkui commented on a change in pull request #16557:
URL: https://github.com/apache/airflow/pull/16557#discussion_r655305332
##########
File path: tests/utils/test_task_group.py
##########
@@ -823,6 +823,23 @@ def section_2(value):
assert extract_node_id(task_group_to_dict(dag.task_group)) == node_ids
+def test_default_args():
+ """Testing TaskGroup with default_args"""
+
+ execution_date = pendulum.parse("20201109")
+ with DAG(
+ dag_id='example_task_group_default_args',
+ start_date=execution_date,
+ default_args={
+ "owner": "dag",
+ },
+ ):
+ with TaskGroup("group1", default_args={"owner": "group"}):
+ task_1 = DummyOperator(task_id='task_1')
+
+ assert task_1.owner == 'group'
Review comment:
make sense, added some test case
##########
File path: airflow/utils/task_group.py
##########
@@ -48,6 +49,13 @@ class TaskGroup(TaskMixin):
:type parent_group: TaskGroup
:param dag: The DAG that this TaskGroup belongs to.
:type dag: airflow.models.DAG
+ :param default_args: A dictionary of default parameters to be used
+ as constructor keyword parameters when initialising operators.
+ Note that operators have the same hook, and precede those defined
Review comment:
thanks for suggestion, added it
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]