arnoldmr01 commented on code in PR #58025:
URL: https://github.com/apache/airflow/pull/58025#discussion_r2513000011
##########
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:
@uranusjr
Yes, the original implementation was using a callable — sorry for
misunderstanding that part. The reason I switched to using a Pendulum DateTime
is that, while I was fixing the issue, I found that the timezone package
couldn’t be imported. When I checked other PRs related to
https://github.com/apache/airflow/issues/56735, they had made a similar change,
so I assumed it might have been influenced by
https://github.com/apache/airflow/pull/56212 However, I now think this was due
to my local environment. Do you think this kind of change is needed or there is
no need to change from timezone to Pendulum?
--
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]