You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/03/01 07:00:46 UTC

[GitHub] [airflow] talnagar commented on a change in pull request #21851: added an option for run id in the ui trigger screen

talnagar commented on a change in pull request #21851:
URL: https://github.com/apache/airflow/pull/21851#discussion_r816495588



##########
File path: airflow/www/views.py
##########
@@ -1838,10 +1839,15 @@ def trigger(self, session=None):
                 form=form,
                 is_dag_run_conf_overrides_params=is_dag_run_conf_overrides_params,
             )
-
-        dr = DagRun.find(dag_id=dag_id, execution_date=execution_date, run_type=DagRunType.MANUAL)
+        # if run_id is not None, filter dag runs based on run id and ignore execution date
+        dr = DagRun.find(
+            dag_id=dag_id,
+            run_type=DagRunType.MANUAL,
+            run_id=run_id,
+            execution_date=execution_date if run_id is None else None,

Review comment:
       The reason I made this change is because the  DagRun.find (looking at existing runs and checking the run_id uniqueness) returns empty results when we send both run_id and execution_date since the combination is not found.
   
   what I tried to do here is:
   1. if there is a run_id - set execution_date to None and filter by the dag_id+run_id+run_type
   2. if run_id is None - filter by dag_id+execution_date+run_type
   
   




-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org