Taragolis commented on code in PR #30083:
URL: https://github.com/apache/airflow/pull/30083#discussion_r1383218351
##########
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 literals PRE_TRANSITION, PRE_TRANSITION will be removed into the
pendulum 3 in favor of of
[`datetime.datetime.fold`](https://docs.python.org/3/library/datetime.html#datetime.datetime.fold)
maybe we could use fold here, and use `dst_rule` depends on fold value `0` or
`1`
Seems like PRE_TRANSITION use same behaviour as fold=0 (default in
datetime.datetime) and POST_TRANSITION same as fold=1, but better to check in
[pendulum 2.1.2
code](https://github.com/sdispater/pendulum/blob/2.1.2/pendulum/tz/timezone.py#L92)
--
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]