xBis7 commented on code in PR #71737:
URL: https://github.com/apache/airflow/pull/71737#discussion_r4293653991


##########
airflow-core/src/airflow/models/task_coordinates.py:
##########
@@ -69,14 +69,30 @@ class _ProducerRequest:
 
 
 class TaskCoordinate(Protocol):
-    """Stored task identity shared by live and retained task data."""
+    """
+    Stored task identity shared by live and retained task data.
 
-    dag_id: str
-    run_id: str
-    task_id: str
-    region_id: UUID
-    region_index: int
-    dag_version_id: UUID | None
+    Read-only on purpose: resolvers only ever read coordinates, and declaring 
them as
+    properties lets immutable views (such as a frozen dataclass) satisfy the 
protocol.
+    """
+
+    @property

Review Comment:
   When these fields are accessed through the `FinishedTI` but the code expects 
`TaskCoordinate`, mypy expects them to be settable but they are read-only and 
we end up with an error.
   
   Making them properties with the `@property` decorator solves the issue and 
it seems to be fine for the current code but I don't have enough context to 
know if keeping this as read-only will be an issue for future plans.
   
   @ashb Any thoughts on this?



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