uranusjr commented on code in PR #25000:
URL: https://github.com/apache/airflow/pull/25000#discussion_r929712844
##########
tests/models/test_dag.py:
##########
@@ -1403,6 +1404,18 @@ def test_create_dagrun_job_id_is_set(self):
)
assert dr.creating_job_id == job_id
+ def test_dag_add_task_sets_default_task_group(self):
+ dag = DAG(dag_id="test_dag_add_task_sets_default_task_group",
start_date=DEFAULT_DATE)
+ task_without_task_group =
EmptyOperator(task_id="task_without_group_id")
+ default_task_group = TaskGroupContext.get_current_task_group(dag)
+ dag.add_task(task_without_task_group)
+ assert default_task_group.get_child_by_label("task_without_group_id")
is not None
Review Comment:
Instead of `is not None` is it better to explicitly compare it to
`task_without_task_group`? (Same question for the variant below)
--
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]