Taragolis commented on code in PR #34744:
URL: https://github.com/apache/airflow/pull/34744#discussion_r1347133750


##########
tests/models/test_dag.py:
##########
@@ -674,8 +674,8 @@ def test_following_previous_schedule(self):
         """
         Make sure DST transitions are properly observed
         """
-        local_tz = pendulum.timezone("Europe/Zurich")
-        start = local_tz.convert(datetime.datetime(2018, 10, 28, 2, 55), 
dst_rule=pendulum.PRE_TRANSITION)
+        local_tz = Timezone("Europe/Zurich")
+        start = local_tz.convert(datetime.datetime(2018, 10, 28, 2, 55, 
fold=0))

Review Comment:
   AFAIK, `PRE_TRANSITION` and `POST_TRANSITION` are used for compatibility 
with Python <3.6 because [fold 
attribute](https://peps.python.org/pep-0495/#the-fold-attribute) introduced in 
Python 3.6.
   I have a look [pendulum 2 
code](https://github.com/sdispater/pendulum/blob/2.1.2/pendulum/tz/timezone.py#L92)
 and `dst_rule` for PRE_TRANSITION  use same behaviour as fold=0, and 
POST_TRANSITION same as fold=1 in most cases, if both `fold` and `dst_rule` not 
set than `PRE_TRANSITION` are used.
   
   So in this tests cases where we use `PRE_TRANSITION` it seems like doesn't 
make any sense to use either `fold` (it set by default to 0) and `dst_rule` (it 
would transformed to same as `fold=0`)



-- 
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]

Reply via email to