You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/12/19 05:15:49 UTC
[GitHub] [airflow] uranusjr commented on a diff in pull request #28400: Rewrite timezone assign codeline
uranusjr commented on code in PR #28400:
URL: https://github.com/apache/airflow/pull/28400#discussion_r1051813105
##########
airflow/models/dag.py:
##########
@@ -462,8 +462,10 @@ def __init__(
# set timezone from start_date
tz = None
if start_date and start_date.tzinfo:
- tzinfo = None if start_date.tzinfo else settings.TIMEZONE
- tz = pendulum.instance(start_date, tz=tzinfo).timezone
+ if start_date.tzinfo is None:
+ tz = pendulum.instance(start_date, tz=settings.TIMEZONE).timezone
+ else:
+ tz = pendulum.instance(start_date).timezone
Review Comment:
This seems wrong? The outer `if if start_date and start_date.tzinfo` should already ensure `start_date.tzinfo` is not None.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org