From 05a8004a2a5549b200f7f3c977d93a0c9bb8bdd7 Mon Sep 17 00:00:00 2001 From: pierrejeambrun Date: Mon, 30 Sep 2024 16:13:52 +0200 Subject: [PATCH] Fix CI --- airflow/api_fastapi/db/dags.py | 1 + airflow/api_fastapi/parameters.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/airflow/api_fastapi/db/dags.py b/airflow/api_fastapi/db/dags.py index 4ed696bb09d1..7cd7cc9cd955 100644 --- a/airflow/api_fastapi/db/dags.py +++ b/airflow/api_fastapi/db/dags.py @@ -43,4 +43,5 @@ and DagRun.dag_id == latest_dag_run_per_dag_id_cte.c.dag_id, isouter=True, ) + .order_by(DagModel.dag_id) ) diff --git a/airflow/api_fastapi/parameters.py b/airflow/api_fastapi/parameters.py index 59253b8315b9..504014602f3b 100644 --- a/airflow/api_fastapi/parameters.py +++ b/airflow/api_fastapi/parameters.py @@ -176,6 +176,10 @@ def to_orm(self, select: Select) -> Select: # MySQL does not support `nullslast`, and True/False ordering depends on the # database implementation. nullscheck = case((column.isnot(None), 0), else_=1) + + # Reset default sorting + select = select.order_by(None) + if self.value[0] == "-": return select.order_by(nullscheck, column.desc(), DagModel.dag_id.desc()) else: