From 8731b2153b92f31200feee4957b4384b8657bc4d Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Fri, 31 Jul 2026 22:11:57 +0800 Subject: [PATCH] Fix airflowctl dags state crash from an incomplete backport The dags state backport (#69915, #70352) brought the caller and the tests but dropped suppress_error_log from DagRunOperations.list(), which main has. dag_command.py:147 passes it, so the command raised: TypeError: DagRunOperations.list() got an unexpected keyword argument 'suppress_error_log' Restore the keyword-only parameter and forward it to the client as the airflowctl_suppress_error_log extension, matching the sibling get(). The broken caller only exists on this test branch, so no released airflowctl is affected and no newsfragment is needed. --- airflow-ctl/src/airflowctl/api/operations.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/airflow-ctl/src/airflowctl/api/operations.py b/airflow-ctl/src/airflowctl/api/operations.py index bbfc18fce2cdf..c51d991fcfdfe 100644 --- a/airflow-ctl/src/airflowctl/api/operations.py +++ b/airflow-ctl/src/airflowctl/api/operations.py @@ -632,6 +632,8 @@ def list( logical_date_gte: datetime.datetime | None = None, logical_date_lte: datetime.datetime | None = None, order_by: str | None = None, + *, + suppress_error_log: bool = False, ) -> DAGRunCollectionResponse | ServerResponseError: """ List dag runs (at most `limit` results). @@ -645,6 +647,7 @@ def list( logical_date_gte: Filter dag runs with a logical date greater than or equal to this value. logical_date_lte: Filter dag runs with a logical date less than or equal to this value. order_by: Order the results by the specified field. + suppress_error_log: Skip client-side error logging, for callers handling the error themselves. """ # Use "~" for all DAGs if dag_id is not specified if not dag_id: @@ -661,7 +664,11 @@ def list( ) try: - self.response = self.client.get(f"/dags/{dag_id}/dagRuns", params=params) + self.response = self.client.get( + f"/dags/{dag_id}/dagRuns", + params=params, + extensions={"airflowctl_suppress_error_log": suppress_error_log}, + ) return DAGRunCollectionResponse.model_validate_json(self.response.content) except ServerResponseError as e: raise e