From b2719aa69151ef1cc0dcba778ca49b3be3fc5709 Mon Sep 17 00:00:00 2001 From: Ash Berlin-Taylor Date: Thu, 7 May 2026 17:15:40 +0100 Subject: [PATCH] Fix incorrect type warning from OTel spans It was rejecting the id attribute we set in the span when the task completed: > Invalid type UUID for attribute 'airflow.task_instance.id' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types It didn't "break" anything, but should be fixed. --- .../airflow/api_fastapi/execution_api/routes/task_instances.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py b/airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py index 0fccd6ad1b61c..13d8245621d63 100644 --- a/airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py +++ b/airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py @@ -493,7 +493,7 @@ def _emit_task_span(ti, state): "airflow.task_instance.try_number": ti.try_number, "airflow.task_instance.map_index": ti.map_index if ti.map_index is not None else -1, "airflow.task_instance.state": state, - "airflow.task_instance.id": ti.id, + "airflow.task_instance.id": str(ti.id), } ) status_code = StatusCode.OK if state == TaskInstanceState.SUCCESS else StatusCode.ERROR