sunank200 commented on code in PR #46992:
URL: https://github.com/apache/airflow/pull/46992#discussion_r1967073819


##########
airflow/cli/commands/dag_command.py:
##########
@@ -365,6 +367,34 @@ def _get_dagbag_dag_details(dag: DAG) -> dict:
     }
 
 
+@cli_utils.action_cli
+@suppress_logs_and_warning
+@providers_configuration_loaded
+@provide_session
+def list_failed_runs():
+        """Lists failed DAG runs within the past 24 hours, grouped by dag_id, 
using AirflowConsole."""
+        since = timezone.make_aware(datetime.now() - timedelta(days=1))
+        dag_runs = DagRun.find(state="failed")
+
+        failed_dags = {}
+        for dag_run in dag_runs:
+            if dag_run.execution_date >= since:

Review Comment:
   There is no `execution_date` anymore. Its renamed to `logical_date`. Please 
check: https://github.com/apache/airflow/blob/main/airflow/models/dagrun.py#L138
   
   Also, this can be None.
   
   Please change the logic here. It is also a good option to use `run_after`.



-- 
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]

Reply via email to