shahar1 commented on code in PR #46584:
URL: https://github.com/apache/airflow/pull/46584#discussion_r1966569878
##########
tests/api_fastapi/execution_api/routes/test_task_instances.py:
##########
@@ -718,6 +719,37 @@ def test_ti_runtime_checks_failure(self, client, session,
create_task_instance):
session.expire_all()
+class TestTISkipDownstream:
+ def setup_method(self):
+ clear_db_runs()
+
+ def teardown_method(self):
+ clear_db_runs()
+
+
+ def test_ti_skip_downstream(
+ self, client, session, create_task_instance, dag_maker
+ ):
+ # from airflow import settings
+ # session = settings.Session()
+ with dag_maker("skip_downstream_dag", session=session):
+ t0 = EmptyOperator(task_id="t0")
+ t1 = EmptyOperator(task_id="t1")
+ t0 >> t1
+ dr = dag_maker.create_dagrun(run_id="run")
+ ti0 = dr.get_task_instance("t0", session=session)
+ ti1 = dr.get_task_instance("t1", session=session)
+ ti0.run()
+ response = client.patch(
+ f"/execution/task-instances/{ti0.id}/skip-downstream",
+ json={"tasks": ["t1"]},
+ )
+ # TODO: How to sync the session in Task SDK?
+ assert response.status_code == 204
+ assert ti0.state == State.SUCCESS
+ assert ti1.state == State.SKIPPED # <- This is failing
Review Comment:
@ashb I'll be happy for some assistance here :)
--
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]