Dev-iL commented on code in PR #57952:
URL: https://github.com/apache/airflow/pull/57952#discussion_r2499689230


##########
task-sdk/src/airflow/sdk/definitions/dag.py:
##########
@@ -1389,13 +1437,13 @@ def _run_task(
             # it is run.
             ti.set_state(TaskInstanceState.QUEUED)
             task_sdk_ti = TaskInstanceSDK(
-                id=ti.id,
+                id=_to_uuid(ti.id, field_name="TaskInstance.id"),

Review Comment:
   That _is_ ultimately what happens internally (see L283), but more 
defensively. The main difference is it doesn't attempt to convert a UUID to 
UUID again (which would fail):
   ```python
   >>> import uuid
   >>> id_ = uuid.uuid4()
   >>> isinstance(id_, uuid.UUID)
   True
   >>> uuid.UUID(id_)
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/usr/python/lib/python3.12/uuid.py", line 175, in __init__
       hex = hex.replace('urn:', '').replace('uuid:', '')
             ^^^^^^^^^^^
   AttributeError: 'UUID' object has no attribute 'replace'
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to