hterik commented on code in PR #34887:
URL: https://github.com/apache/airflow/pull/34887#discussion_r1356736539


##########
airflow/www/views.py:
##########
@@ -3465,25 +3466,42 @@ def grid_data(self):
         if num_runs is None:
             num_runs = conf.getint("webserver", 
"default_dag_run_display_number")
 
-        try:
-            base_date = timezone.parse(request.args["base_date"], strict=True)
-        except (KeyError, ValueError):
-            base_date = dag.get_latest_execution_date() or timezone.utcnow()
+        dagrun = None
+        if run_id:
+            with create_session() as session:
+                dagrun = dag.get_dagrun(run_id=run_id, session=session)
+                if not dagrun:
+                    return {"error": f"can't find dag_run_id={run_id}"}, 404
+            base_date = dagrun.execution_date

Review Comment:
   The old code in `get_date_time_num_runs_dag_runs_form_data` that does 
similar lookups has following workaround, is that still needed here also? 
   
           # The DateTimeField widget truncates milliseconds and would loose
           # the first dag run. Round to next second.
           base_date = (date_time + 
datetime.timedelta(seconds=1)).replace(microsecond=0)
   
   I didn't see any such issue during my short exploratory testing of this.



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

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

Reply via email to