uranusjr commented on pull request #18968: URL: https://github.com/apache/airflow/pull/18968#issuecomment-945336188
Actually, DagRun has a unique constraint on _both_ `execution_date` and `run_id`. So while this fixes the duplicated `execution_date` issue, it'd introduce a new issue of duplicated `run_id` (which is possible with manual runs, where the user can customise `run_id`). So this should do a SQL `WHERE run_id = ? OR execution_date = ?` query instead. `DagRun.find()` does not support this, but I think the lookup logic is common enough to warrant a new method, say `DagRun.find_duplicate(dag_id, run_id, execution_date)` (where all three arguments are required). There is actually already at least one occurence, maybe more (I didn't search very hard). https://github.com/apache/airflow/blob/86a2a19ad2bdc87a9ad14bb7fde9313b2d7489bb/airflow/api_connexion/endpoints/dag_run_endpoint.py#L256-L263 -- 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]
