jason810496 commented on code in PR #55160:
URL: https://github.com/apache/airflow/pull/55160#discussion_r2353690743


##########
airflow-core/src/airflow/models/log.py:
##########
@@ -56,6 +56,14 @@ class Log(Base):
         primaryjoin="Log.dag_id == DagModel.dag_id",
     )
 
+    task_instance = relationship(
+        "TaskInstance",
+        viewonly=True,
+        foreign_keys=[task_id],
+        primaryjoin="Log.task_id == TaskInstance.task_id",
+        lazy="selectin",
+    )
+

Review Comment:
   I agree with both Pierre and Guan-Ming, setting `lazy="noload"` LGTM.
   
   If everyone agrees on using `lazy="noload"`, let's also review previous PRs 
where aliases were added. We should ensure those relationships are set to 
`lazy="noload"` to avoid performance side effect, while still benefiting from 
easier queries and IDE type hints.



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