You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ephraimbuddy (via GitHub)" <gi...@apache.org> on 2023/08/04 08:04:32 UTC

[GitHub] [airflow] ephraimbuddy commented on a diff in pull request #33102: Don't auto-add to context just by virtue of arrowing

ephraimbuddy commented on code in PR #33102:
URL: https://github.com/apache/airflow/pull/33102#discussion_r1284116947


##########
tests/models/test_taskmixin.py:
##########
@@ -252,7 +256,10 @@ def test_set_setup_teardown_ctx_dependencies_using_decorated_tasks(dag_maker):
         t3 = make_task("t3", type_="decorated")
         setuptask = make_task("setuptask", type_="decorated", setup_=True)
         teardowntask = make_task("teardowntask", type_="decorated", teardown_=True)
-        with setuptask >> teardowntask:
+        with setuptask >> teardowntask as scope:
+            scope.add_task(t1)
+            scope.add_task(t2)
+            scope.add_task(t3)

Review Comment:
   I think we should move instantiating the tasks into the context manager instead of using `add_task`



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org