uranusjr commented on code in PR #58025:
URL: https://github.com/apache/airflow/pull/58025#discussion_r2512880556
##########
airflow-core/src/airflow/models/dagrun.py:
##########
@@ -2147,9 +2150,9 @@ class DagRunNote(Base):
user_id: Mapped[str | None] = mapped_column(String(128), nullable=True)
dag_run_id: Mapped[int] = mapped_column(Integer, primary_key=True,
nullable=False)
content: Mapped[str | None] =
mapped_column(String(1000).with_variant(Text(1000), "mysql"))
- created_at: Mapped[datetime] = mapped_column(UtcDateTime,
default=timezone.utcnow, nullable=False)
+ created_at: Mapped[datetime] = mapped_column(UtcDateTime,
default=pendulum.now(tz="UTC"), nullable=False)
updated_at: Mapped[datetime] = mapped_column(
- UtcDateTime, default=timezone.utcnow, onupdate=timezone.utcnow,
nullable=False
+ UtcDateTime, default=pendulum.now(tz="UTC"),
onupdate=pendulum.now(tz="UTC"), nullable=False
Review Comment:
This is wrong. Original implementation uses a callable, which is called
lazily when a new object is inserted. This makes all rows uses whatever time it
is when the module is imported.
--
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]