This is an automated email from the ASF dual-hosted git repository.

guanmingchiu pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-1-test by this push:
     new ade60b39c25 [v3-1-test] Add task_display_name to 
LightGridTaskInstanceSummary model (#61440) (#61505)
ade60b39c25 is described below

commit ade60b39c25863f2f8841a52c39851e77a907363
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Feb 6 19:10:40 2026 +0800

    [v3-1-test] Add task_display_name to LightGridTaskInstanceSummary model 
(#61440) (#61505)
    
    (cherry picked from commit c385e598eb269f28a522c69f2001779fea8d8a87)
    
    Signed-off-by: Guan-Ming (Wesley) Chiu 
<[email protected]>
    Co-authored-by: Guan-Ming (Wesley) Chiu 
<[email protected]>
---
 .../airflow/api_fastapi/core_api/datamodels/ui/grid.py  |  1 +
 .../api_fastapi/core_api/openapi/_private_ui.yaml       |  4 ++++
 .../src/airflow/api_fastapi/core_api/routes/ui/grid.py  |  1 +
 .../airflow/api_fastapi/core_api/services/ui/grid.py    |  3 +++
 .../src/airflow/ui/openapi-gen/requests/schemas.gen.ts  |  6 +++++-
 .../src/airflow/ui/openapi-gen/requests/types.gen.ts    |  1 +
 .../airflow/ui/src/pages/GroupTaskInstance/Header.tsx   |  2 +-
 .../airflow/ui/src/pages/MappedTaskInstance/Header.tsx  |  2 +-
 .../unit/api_fastapi/core_api/routes/ui/test_grid.py    | 17 +++++++++++++++++
 9 files changed, 34 insertions(+), 3 deletions(-)

diff --git 
a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/grid.py 
b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/grid.py
index b523dce96ff..52fa35675c2 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/grid.py
+++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/grid.py
@@ -28,6 +28,7 @@ class LightGridTaskInstanceSummary(BaseModel):
     """Task Instance Summary model for the Grid UI."""
 
     task_id: str
+    task_display_name: str
     state: TaskInstanceState | None
     child_states: dict[TaskInstanceState | None, int] | None
     min_start_date: datetime | None
diff --git 
a/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml 
b/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml
index 7ff73105164..10f9d7e5b4c 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml
+++ b/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml
@@ -2063,6 +2063,9 @@ components:
         task_id:
           type: string
           title: Task Id
+        task_display_name:
+          type: string
+          title: Task Display Name
         state:
           anyOf:
           - $ref: '#/components/schemas/TaskInstanceState'
@@ -2089,6 +2092,7 @@ components:
       type: object
       required:
       - task_id
+      - task_display_name
       - state
       - child_states
       - min_start_date
diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py 
b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py
index a95bb5c7f56..6510a19f12c 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py
+++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py
@@ -417,6 +417,7 @@ def get_grid_ti_summaries(
             agg = _get_aggs_for_node(detail)
             yield {
                 "task_id": task_id,
+                "task_display_name": task_id,
                 "type": "task",
                 "parent_id": None,
                 **agg,
diff --git a/airflow-core/src/airflow/api_fastapi/core_api/services/ui/grid.py 
b/airflow-core/src/airflow/api_fastapi/core_api/services/ui/grid.py
index 5b20511d31f..68520371116 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/services/ui/grid.py
+++ b/airflow-core/src/airflow/api_fastapi/core_api/services/ui/grid.py
@@ -95,6 +95,7 @@ def _find_aggregates(
         mapped_details = details or [{"state": None, "start_date": None, 
"end_date": None}]
         yield {
             "task_id": node_id,
+            "task_display_name": node.task_display_name,
             "type": "mapped_task",
             "parent_id": parent_id,
             **_get_aggs_for_node(mapped_details),
@@ -114,6 +115,7 @@ def _find_aggregates(
         if node_id:
             yield {
                 "task_id": node_id,
+                "task_display_name": node_id,
                 "type": "group",
                 "parent_id": parent_id,
                 **_get_aggs_for_node(children_details),
@@ -123,6 +125,7 @@ def _find_aggregates(
     if isinstance(node, SerializedBaseOperator):
         yield {
             "task_id": node_id,
+            "task_display_name": node.task_display_name,
             "type": "task",
             "parent_id": parent_id,
             **_get_aggs_for_node(details),
diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts 
b/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts
index 7366d970a68..34a549a9070 100644
--- a/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts
+++ b/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts
@@ -7525,6 +7525,10 @@ export const $LightGridTaskInstanceSummary = {
             type: 'string',
             title: 'Task Id'
         },
+        task_display_name: {
+            type: 'string',
+            title: 'Task Display Name'
+        },
         state: {
             anyOf: [
                 {
@@ -7575,7 +7579,7 @@ export const $LightGridTaskInstanceSummary = {
         }
     },
     type: 'object',
-    required: ['task_id', 'state', 'child_states', 'min_start_date', 
'max_end_date'],
+    required: ['task_id', 'task_display_name', 'state', 'child_states', 
'min_start_date', 'max_end_date'],
     title: 'LightGridTaskInstanceSummary',
     description: 'Task Instance Summary model for the Grid UI.'
 } as const;
diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts 
b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts
index 33cc7992bad..c5a755153ce 100644
--- a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts
+++ b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts
@@ -1892,6 +1892,7 @@ export type HistoricalMetricDataResponse = {
  */
 export type LightGridTaskInstanceSummary = {
     task_id: string;
+    task_display_name: string;
     state: TaskInstanceState | null;
     child_states: {
     [key: string]: (number);
diff --git a/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/Header.tsx 
b/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/Header.tsx
index 16731d4de4c..968e3ef8cd5 100644
--- a/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/Header.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/Header.tsx
@@ -59,7 +59,7 @@ export const Header = ({ taskInstance }: { readonly 
taskInstance: LightGridTaskI
         state={taskInstance.state}
         stats={stats}
         subTitle={<Time datetime={taskInstance.min_start_date} />}
-        title={taskInstance.task_id}
+        title={taskInstance.task_display_name}
       />
     </Box>
   );
diff --git 
a/airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/Header.tsx 
b/airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/Header.tsx
index 88d6bb122b6..97c86581a23 100644
--- a/airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/Header.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/Header.tsx
@@ -59,7 +59,7 @@ export const Header = ({ taskInstance }: { readonly 
taskInstance: LightGridTaskI
         state={taskInstance.state}
         stats={stats}
         subTitle={<Time datetime={taskInstance.min_start_date} />}
-        title={`${taskInstance.task_id} [${taskCount}]`}
+        title={`${taskInstance.task_display_name} [${taskCount}]`}
       />
     </Box>
   );
diff --git 
a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_grid.py 
b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_grid.py
index 4b0818dc1c5..0c2b64ec28b 100644
--- a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_grid.py
+++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_grid.py
@@ -599,6 +599,7 @@ class TestGetGridDataEndpoint:
                 {
                     "state": "success",
                     "task_id": "t1",
+                    "task_display_name": "t1",
                     "child_states": None,
                     "max_end_date": None,
                     "min_start_date": None,
@@ -606,6 +607,7 @@ class TestGetGridDataEndpoint:
                 {
                     "state": "success",
                     "task_id": "t2",
+                    "task_display_name": "t2",
                     "child_states": None,
                     "max_end_date": None,
                     "min_start_date": None,
@@ -613,6 +615,7 @@ class TestGetGridDataEndpoint:
                 {
                     "state": "success",
                     "task_id": "t7",
+                    "task_display_name": "t7",
                     "child_states": None,
                     "max_end_date": None,
                     "min_start_date": None,
@@ -623,10 +626,12 @@ class TestGetGridDataEndpoint:
                     "min_start_date": "2025-03-02T00:00:04Z",
                     "state": "success",
                     "task_id": "task_group-1",
+                    "task_display_name": "task_group-1",
                 },
                 {
                     "state": "success",
                     "task_id": "task_group-1.t6",
+                    "task_display_name": "task_group-1.t6",
                     "child_states": None,
                     "max_end_date": None,
                     "min_start_date": None,
@@ -637,10 +642,12 @@ class TestGetGridDataEndpoint:
                     "min_start_date": "2025-03-02T00:00:06Z",
                     "state": "success",
                     "task_id": "task_group-1.task_group-2",
+                    "task_display_name": "task_group-1.task_group-2",
                 },
                 {
                     "state": "success",
                     "task_id": "task_group-1.task_group-2.t3",
+                    "task_display_name": "task_group-1.task_group-2.t3",
                     "child_states": None,
                     "max_end_date": None,
                     "min_start_date": None,
@@ -648,6 +655,7 @@ class TestGetGridDataEndpoint:
                 {
                     "state": "success",
                     "task_id": "task_group-1.task_group-2.t4",
+                    "task_display_name": "task_group-1.task_group-2.t4",
                     "child_states": None,
                     "max_end_date": None,
                     "min_start_date": None,
@@ -655,6 +663,7 @@ class TestGetGridDataEndpoint:
                 {
                     "state": "success",
                     "task_id": "task_group-1.task_group-2.t5",
+                    "task_display_name": "task_group-1.task_group-2.t5",
                     "child_states": None,
                     "max_end_date": None,
                     "min_start_date": None,
@@ -688,6 +697,7 @@ class TestGetGridDataEndpoint:
             {
                 "child_states": {"None": 1},
                 "task_id": "mapped_task_2",
+                "task_display_name": "mapped_task_2",
                 "max_end_date": None,
                 "min_start_date": None,
                 "state": None,
@@ -698,10 +708,12 @@ class TestGetGridDataEndpoint:
                 "min_start_date": "2024-12-30T01:00:00Z",
                 "state": "running",
                 "task_id": "mapped_task_group",
+                "task_display_name": "mapped_task_group",
             },
             {
                 "state": "running",
                 "task_id": "mapped_task_group.subtask",
+                "task_display_name": "mapped_task_group.subtask",
                 "child_states": None,
                 "max_end_date": None,
                 "min_start_date": None,
@@ -709,6 +721,7 @@ class TestGetGridDataEndpoint:
             {
                 "state": "success",
                 "task_id": "task",
+                "task_display_name": "A Beautiful Task Name \U0001f680",
                 "child_states": None,
                 "max_end_date": None,
                 "min_start_date": None,
@@ -716,6 +729,7 @@ class TestGetGridDataEndpoint:
             {
                 "child_states": {"None": 6},
                 "task_id": "task_group",
+                "task_display_name": "task_group",
                 "max_end_date": None,
                 "min_start_date": None,
                 "state": None,
@@ -723,6 +737,7 @@ class TestGetGridDataEndpoint:
             {
                 "child_states": {"None": 2},
                 "task_id": "task_group.inner_task_group",
+                "task_display_name": "task_group.inner_task_group",
                 "max_end_date": None,
                 "min_start_date": None,
                 "state": None,
@@ -730,6 +745,7 @@ class TestGetGridDataEndpoint:
             {
                 "child_states": {"None": 2},
                 "task_id": 
"task_group.inner_task_group.inner_task_group_sub_task",
+                "task_display_name": "Inner Task Group Sub Task Label",
                 "max_end_date": None,
                 "min_start_date": None,
                 "state": None,
@@ -737,6 +753,7 @@ class TestGetGridDataEndpoint:
             {
                 "child_states": {"None": 4},
                 "task_id": "task_group.mapped_task",
+                "task_display_name": "task_group.mapped_task",
                 "max_end_date": None,
                 "min_start_date": None,
                 "state": None,

Reply via email to