guan404ming commented on code in PR #54820:
URL: https://github.com/apache/airflow/pull/54820#discussion_r2294037534


##########
airflow-core/src/airflow/models/dagwarning.py:
##########
@@ -47,6 +48,8 @@ class DagWarning(Base):
     message = Column(Text, nullable=False)
     timestamp = Column(UtcDateTime, nullable=False, default=timezone.utcnow)
 
+    dag = relationship("DagModel", viewonly=True, lazy="selectin")

Review Comment:
   > May I ask if there is any particular reason for using lazy="selectin" 
instead of primaryjoin in this case?
   
   lazy="selectin" is better for this simple foreign key relationship like 
here. SQLAlchemy can automatically determine the join condition, making the 
code cleaner and more maintainable. primaryjoin could be used for complex 
custom conditions that SQLAlchemy can't infer automatically. So I think I could 
take a look for previous alias pr and refactor them to maintain consistent and 
adopt better implementation.
   
   



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