ashb commented on a change in pull request #11652:
URL: https://github.com/apache/airflow/pull/11652#discussion_r511151414
##########
File path: airflow/www/utils.py
##########
@@ -302,6 +311,48 @@ def dag_run_link(attr):
'<a href="{url}">{run_id}</a>').format(url=url, run_id=run_id) # noqa
+def dag_query_for_key(sorting_key):
+ """Maps sorting key param in the URL params to DB queries on appropriate
attributes."""
+ dag_query_key_map = {
+ 'dag_id': DagModel.dag_id,
+ 'owner': DagModel.owners,
+ 'schedule': DagModel.next_dagrun,
+ # <- add any extra (URL param)->(DagModel attr) mappings here
+ }
Review comment:
(If you think the current way is clearer, tell me. But I do think the
location is wrong for this, as it is specific to one particular view.)
----------------------------------------------------------------
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]