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/08/10 10:12:28 UTC

[GitHub] [airflow] uranusjr opened a new pull request, #25633: Allow per-timetable ordering override in grid view

uranusjr opened a new pull request, #25633:
URL: https://github.com/apache/airflow/pull/25633

   Close #25090.
   
   I wonder if there are any other views that would benefit from this custom ordering logic.


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


[GitHub] [airflow] uranusjr merged pull request #25633: Allow per-timetable ordering override in grid view

Posted by GitBox <gi...@apache.org>.
uranusjr merged PR #25633:
URL: https://github.com/apache/airflow/pull/25633


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


[GitHub] [airflow] bbovenzi commented on a diff in pull request #25633: Allow per-timetable ordering override in grid view

Posted by GitBox <gi...@apache.org>.
bbovenzi commented on code in PR #25633:
URL: https://github.com/apache/airflow/pull/25633#discussion_r946939393


##########
airflow/www/views.py:
##########
@@ -3622,8 +3622,10 @@ def grid_data(self):
             if run_state:
                 query = query.filter(DagRun.state == run_state)
 
-            dag_runs = query.order_by(DagRun.execution_date.desc()).limit(num_runs).all()
+            ordering = (DagRun.__table__.columns[name].desc() for name in dag.timetable.run_ordering)

Review Comment:
   Yeah, that'll be good. But let's do that as a subsequent PR since it breaks a lot of tests and needs a bunch of UI changes.



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


[GitHub] [airflow] bbovenzi commented on pull request #25633: Allow per-timetable ordering override in grid view

Posted by GitBox <gi...@apache.org>.
bbovenzi commented on PR #25633:
URL: https://github.com/apache/airflow/pull/25633#issuecomment-1211079119

   I seem to be having a problem if there are also manually triggered runs, they're all appended to the end, regardless of date.
   <img width="449" alt="Screen Shot 2022-08-10 at 2 09 28 PM" src="https://user-images.githubusercontent.com/4600967/183985704-7ff88e4c-f715-422c-a79d-dbc576341d64.png">
   


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


[GitHub] [airflow] uranusjr commented on pull request #25633: Allow per-timetable ordering override in grid view

Posted by GitBox <gi...@apache.org>.
uranusjr commented on PR #25633:
URL: https://github.com/apache/airflow/pull/25633#issuecomment-1217348721

   CI failure also happening in main, see #25751


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


[GitHub] [airflow] uranusjr commented on a diff in pull request #25633: Allow per-timetable ordering override in grid view

Posted by GitBox <gi...@apache.org>.
uranusjr commented on code in PR #25633:
URL: https://github.com/apache/airflow/pull/25633#discussion_r946331067


##########
airflow/www/views.py:
##########
@@ -3622,8 +3622,10 @@ def grid_data(self):
             if run_state:
                 query = query.filter(DagRun.state == run_state)
 
-            dag_runs = query.order_by(DagRun.execution_date.desc()).limit(num_runs).all()
+            ordering = (DagRun.__table__.columns[name].desc() for name in dag.timetable.run_ordering)

Review Comment:
   Yes, we should. I added a field `dag_run_ordering` in the response JSON that’s a list of DAG run fields used for ordering. Would this be enough?



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


[GitHub] [airflow] uranusjr commented on pull request #25633: Allow per-timetable ordering override in grid view

Posted by GitBox <gi...@apache.org>.
uranusjr commented on PR #25633:
URL: https://github.com/apache/airflow/pull/25633#issuecomment-1212712035

   Ah makes sense, I’ll add a special case for them.


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


[GitHub] [airflow] uranusjr commented on pull request #25633: Allow per-timetable ordering override in grid view

Posted by GitBox <gi...@apache.org>.
uranusjr commented on PR #25633:
URL: https://github.com/apache/airflow/pull/25633#issuecomment-1211482202

   What schedule does the DAG use?


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


[GitHub] [airflow] bbovenzi commented on pull request #25633: Allow per-timetable ordering override in grid view

Posted by GitBox <gi...@apache.org>.
bbovenzi commented on PR #25633:
URL: https://github.com/apache/airflow/pull/25633#issuecomment-1212036648

   > What schedule does the DAG use?
   
   That one was a dataset-triggered. A regular schedule seems to work fine though


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


[GitHub] [airflow] bbovenzi commented on a diff in pull request #25633: Allow per-timetable ordering override in grid view

Posted by GitBox <gi...@apache.org>.
bbovenzi commented on code in PR #25633:
URL: https://github.com/apache/airflow/pull/25633#discussion_r946151278


##########
airflow/www/views.py:
##########
@@ -3622,8 +3622,10 @@ def grid_data(self):
             if run_state:
                 query = query.filter(DagRun.state == run_state)
 
-            dag_runs = query.order_by(DagRun.execution_date.desc()).limit(num_runs).all()
+            ordering = (DagRun.__table__.columns[name].desc() for name in dag.timetable.run_ordering)

Review Comment:
   Should we have the UI read `ordering` in order to know when to use `data_interval_end` as a label instead of `data_interval_start`?



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


[GitHub] [airflow] uranusjr commented on a diff in pull request #25633: Allow per-timetable ordering override in grid view

Posted by GitBox <gi...@apache.org>.
uranusjr commented on code in PR #25633:
URL: https://github.com/apache/airflow/pull/25633#discussion_r946331067


##########
airflow/www/views.py:
##########
@@ -3622,8 +3622,10 @@ def grid_data(self):
             if run_state:
                 query = query.filter(DagRun.state == run_state)
 
-            dag_runs = query.order_by(DagRun.execution_date.desc()).limit(num_runs).all()
+            ordering = (DagRun.__table__.columns[name].desc() for name in dag.timetable.run_ordering)

Review Comment:
   Ah, yes, we should. I’ll add a field in the response JSON and leave the UI part to you.



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


[GitHub] [airflow] uranusjr commented on a diff in pull request #25633: Allow per-timetable ordering override in grid view

Posted by GitBox <gi...@apache.org>.
uranusjr commented on code in PR #25633:
URL: https://github.com/apache/airflow/pull/25633#discussion_r947316527


##########
airflow/www/views.py:
##########
@@ -3622,8 +3622,10 @@ def grid_data(self):
             if run_state:
                 query = query.filter(DagRun.state == run_state)
 
-            dag_runs = query.order_by(DagRun.execution_date.desc()).limit(num_runs).all()
+            ordering = (DagRun.__table__.columns[name].desc() for name in dag.timetable.run_ordering)

Review Comment:
   Reverted the addition.



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