Bowrna commented on code in PR #23731: URL: https://github.com/apache/airflow/pull/23731#discussion_r878657728
########## tests/jobs/test_scheduler_job.py: ########## @@ -4120,22 +4120,40 @@ def test_task_with_upstream_skip_process_task_instances(): dr = dag.create_dagrun(run_type=DagRunType.MANUAL, state=State.RUNNING, execution_date=DEFAULT_DATE) assert dr is not None + # def get_ti_from_db(task): + # return ( + # session.query(TaskInstance) + # .filter( + # TaskInstance.dag_id == dag.dag_id, + # TaskInstance.task_id == task.task_id, + # TaskInstance.run_id == dr.run_id, + # ) + # .one() + # ) + + # with create_session() as session: + # get_ti_from_db(dummy1).state = State.SKIPPED + # get_ti_from_db(dummy2).state = State.SUCCESS + # session.flush() + with create_session() as session: tis = {ti.task_id: ti for ti in dr.get_task_instances(session=session)} # Set dummy1 to skipped and dummy2 to success. dummy3 remains as none. tis[dummy1.task_id].state = State.SKIPPED tis[dummy2.task_id].state = State.SUCCESS assert tis[dummy3.task_id].state == State.NONE + session.commit() + # dr.refresh_from_db(session=session) # dag_runs = DagRun.find(dag_id='test_task_with_upstream_skip_dag') Review Comment: yes i took time to look but I am confused on this part. Let me try again -- 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-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org