dataset = Dataset(uri="hello")
        with dag_maker(
            session=session,
            dag_id="my_dag",
            max_active_runs=1,
            schedule=[dataset],
            start_date=pendulum.now().add(days=-2),
        ) as dag:
            EmptyOperator(task_id="dummy")
        
        query, _ = DagModel.dags_needing_dagruns(session)
        dag_models = query.all()
        assert dag_models == []
        
        dag_model = session.query(DagModel).filter(DagModel.dag_id == dag.dag_id).one()
        dataset_model: DatasetModel = dag_model.schedule_datasets[0]
        session.add(DatasetDagRunQueue(dataset_id=dataset_model.id, target_dag_id=dag_model.dag_id))
        session.flush()
        query, _ = DagModel.dags_needing_dagruns(session)
        dag_models = query.all()
        assert dag_models == [dag_model]
        
        dag_maker.create_dagrun(
            run_type=DagRunType.DATASET_TRIGGERED,
            state=DagRunState.QUEUED,