dag_id=dag_id1,
            run_id=dag_id1,
            run_type=DagRunType.MANUAL,
            execution_date=now,
            start_date=now,
            state=DagRunState.RUNNING,
            external_trigger=True,
        )
        session.add(dag_run)
        dag_id2 = "test_dagrun_find_not_externally_triggered"
        dag_run = DagRun(
            dag_id=dag_id2,
            run_id=dag_id2,
            run_type=DagRunType.MANUAL,
            execution_date=now,
            start_date=now,
            state=DagRunState.RUNNING,
            external_trigger=False,
        )
        session.add(dag_run)
        session.commit()
        assert 1 == len(DagRun.find(dag_id=dag_id1, external_trigger=True))
        assert 1 == len(DagRun.find(run_id=dag_id1))
        assert 2 == len(DagRun.find(run_id=[dag_id1, dag_id2]))
        assert 2 == len(DagRun.find(execution_date=[now, now]))
        assert 2 == len(DagRun.find(execution_date=now))
        assert 0 == len(DagRun.find(dag_id=dag_id1, external_trigger=False))
        assert 0 == len(DagRun.find(dag_id=dag_id2, external_trigger=True))
        assert 1 == len(DagRun.find(dag_id=dag_id2, external_trigger=False))
    def test_dagrun_find_duplicate(self, session):