AlenkaF commented on a change in pull request #12522:
URL: https://github.com/apache/arrow/pull/12522#discussion_r822637011



##########
File path: python/pyarrow/tests/strategies.py
##########
@@ -266,10 +277,12 @@ def arrays(draw, type, size=None, nullable=True):
         min_datetime = datetime.datetime.fromtimestamp(min_int64 // 10**9)
         max_datetime = datetime.datetime.fromtimestamp(max_int64 // 10**9)
         try:
-            offset_hours = int(ty.tz)
-            tz = pytz.FixedOffset(offset_hours * 60)
+            offset = ty.tz.split(":")
+            offset_hours = int(offset[0])
+            offset_min = int(offset[1])
+            tz = datetime.timedelta(hours=offset_hours, minutes=offset_min)
         except ValueError:
-            tz = pytz.timezone(ty.tz)
+            tz = zoneinfo.ZoneInfo(ty.tz)

Review comment:
       Yes, I wasn't able to get to this correction till today.
   
   Trouble is that in case of `tz=None` the method `tzinfo_to_string` errors 
with `Not an instance of datetime.tzinfo` which I think is correct behaviour. 
Putting an extra skip in the test seems off. I will try to use the `timezones` 
from `pyarrow.tests.strategies` as you suggested in another comment and see if 
it works.
   




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