uranusjr commented on code in PR #30083:
URL: https://github.com/apache/airflow/pull/30083#discussion_r1403979471
##########
airflow/utils/timezone.py:
##########
@@ -74,6 +77,18 @@ def utc_epoch() -> dt.datetime:
return result
+def in_timezone(datetime: DateTime, tz: Timezone, dst_rule: str =
pendulum.PRE_TRANSITION) -> DateTime:
Review Comment:
Pendulum 2.1.2 actually already supports using `fold` to control transition.
https://github.com/sdispater/pendulum/blob/d9aa101fe76852b75cba14d686ede923641c5b4d/pendulum/tz/timezone.py#L100-L103
This was added 6 years ago. I didn’t check which version. It should be safe
to use it.
https://github.com/sdispater/pendulum/commit/5be0094a89d629af5fd2d87164d1c0b8e2c8bde8
##########
airflow/utils/timezone.py:
##########
@@ -74,6 +77,18 @@ def utc_epoch() -> dt.datetime:
return result
+def in_timezone(datetime: DateTime, tz: Timezone, dst_rule: str =
pendulum.PRE_TRANSITION) -> DateTime:
Review Comment:
Pendulum 2.1.2 actually already supports using `fold` to control transition.
https://github.com/sdispater/pendulum/blob/d9aa101fe76852b75cba14d686ede923641c5b4d/pendulum/tz/timezone.py#L100-L103
This was added 6 years ago. I didn’t check which version. It should be safe
to use it.
https://github.com/sdispater/pendulum/commit/5be0094a89d629af5fd2d87164d1c0b8e2c8bde8
--
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]