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


##########
airflow/utils/timezone.py:
##########
@@ -273,3 +274,19 @@ def _format_part(key: str) -> str:
     if not joined:
         return "<1s"
     return joined
+
+
+def parse_timezone(name: str | int):
+    """
+    Parse timezone and return one of the pendulum Timezone.
+
+    Provide the same interface as ``pendulum.tz.timezone(name)``
+
+    .. note::
+        This class for compatibility between pendulum 2 and 3.
+        In pendulum 3 ``pendulum.tz.timezone`` it is a module, which can't be 
used as parser
+        In pendulum 2 ``pendulum.timezone`` mypy failed on static check
+
+    :meta: private
+    """
+    return pendulum.timezone(name)  # type: ignore[operator]

Review Comment:
   Cache around `parse_timezone` sounds good to me!



-- 
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-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to