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


##########
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:
   BTW, I think if we want to keep a cache we might decorate by `lru_cache`.



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