scrdest opened a new pull request #11652:
URL: https://github.com/apache/airflow/pull/11652


   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   Adds support for sorting DAGs in the UI by the ID, Schedule (next run, 
really) and Owner, ASC/DESC.
   
   The sorting is done on the DB level and parameterized by two new URL 
parameters - sortBy for the model attribute & orderBy for the type of ordering 
(ascending/descending).
   
   The default behavior is to sort by Dag ID and order by ascending, and 
therefore should not come as a surprise to current users.
   
   The column headings in the DAG view have been turned to hyperlinks that pass 
the parameters for the sorting. For more predictable UX, when switching before 
sorting attributes (or when none is passed), clicking on a header will always 
sort it by ASC first. Clicking on the same header again after the page reloads 
will toggle it to DESC instead. Visually:
   
   ```
   (None)->[Dag ID] => (Dag ID ASC)
   (Dag ID ASC) -> [Dag ID] => (Dag ID DESC)
   (Dag ID DESC) -> [Dag ID] => (Dag ID ASC)
   (Dag ID ASC) -> [Owner] => (Owner ASC)
   (Dag ID DESC) -> [Owner] => (Owner ASC)
   ```
   
   Unfortunately, sorting by the most recently executed run as requested by 
#8459 is *not* supported yet. The current options were fairly straightforward 
to handle since the logic that populates the DAG list currently fetches a set 
of DagModels - this is just an exercise in filtering. Fetching and sorting 
DagRuns ran the risk of adding a fair bit of extra processing overhead and 
complicating the logic.
   
   closes: #8459 
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)**
 for more information.
   In case of fundamental code change, Airflow Improvement Proposal 
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals))
 is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party 
License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in 
[UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to