kxepal commented on issue #26505:
URL: https://github.com/apache/airflow/issues/26505#issuecomment-1253536779

   Hi there! Follow up from dev ML.
   
   We faced exactly the same issue after upgrade from 2.3.4 to 2.4.0 for all 
our dags. All of them has quite a history up to 2016 year, so a lot of dag 
runs. Somehow grid show for us latest runs at 2021.11 while other views 
(calendar, graph) shows all of them and the most recent ones.
   
   The exact fix which solved this problem is:
   ```
   --- airflow/www/views.py
   +++ airflow/www/views.py
   @@ -3453,8 +3460,9 @@ class Airflow(AirflowBaseView):
                if run_state:
                    query = query.filter(DagRun.state == run_state)
    
   -            ordering = (DagRun.__table__.columns[name].desc() for name in 
dag.timetable.run_ordering)
   -            dag_runs = query.order_by(*ordering, 
DagRun.id.desc()).limit(num_runs).all()
   +            dag_runs = 
query.order_by(DagRun.execution_date.desc()).limit(num_runs).all(
                dag_runs.reverse()
    
                encoded_runs = [wwwutils.encode_dag_run(dr) for dr in dag_runs]
   ```
   
   It feels like there is a problem between data and logic that operates it, 
but not sure where and what is it. 


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