yc0 opened a new issue, #34713: URL: https://github.com/apache/airflow/issues/34713
### Apache Airflow version 2.7.1 ### What happened While we use trigger_run to trigger DAG, we sometimes get duplicate run_ids even if we actually give the different names of run_ids. According to code https://github.com/apache/airflow/blob/4c1808bb8991c990ef2b7ef3554a5a4a5fb6078f/airflow/models/dagrun.py#L453 ``` def find_duplicate( #emit return session.scalars( select(cls).where( cls.dag_id == dag_id, or_(cls.run_id == run_id, cls.execution_date == execution_date), ) ).one_or_none() ``` Could we use `and_` instead of `or_` ? any comment or concern to adopt the or_ operator? ### What you think should happen instead we should use `and_` instead of `or_`? any comment or concern to adopt the or_ operator? ### How to reproduce use for_loop to execute trigger_run, you will face this issue ### Operating System Debian GNU/Linux 11 (bullseye) ### Versions of Apache Airflow Providers apache-airflow-providers-celery==3.3.3 apache-airflow-providers-cncf-kubernetes==7.5.0 apache-airflow-providers-common-sql==1.7.1 apache-airflow-providers-ftp==3.5.1 apache-airflow-providers-http==4.5.1 apache-airflow-providers-imap==3.3.1 apache-airflow-providers-sqlite==3.4.3 ### Deployment Official Apache Airflow Helm Chart ### Deployment details _No response_ ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md) -- 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]
