jason810496 commented on code in PR #54820:
URL: https://github.com/apache/airflow/pull/54820#discussion_r2294157172
##########
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:
> 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.
Thanks for the clarification.
> So I think I could take a look for previous alias pr and refactor them to
maintain consistent and adopt better implementation.
Sure, the refactor can be done in follow-up PR, thanks!
--
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]