jorisvandenbossche commented on code in PR #37436:
URL: https://github.com/apache/arrow/pull/37436#discussion_r1311198046
##########
python/pyarrow/__init__.py:
##########
@@ -157,6 +157,15 @@ def print_entry(label, value):
print(f" {codec: <20}: {status: <8}")
+if _sys.platform == 'win32':
+ tzdata_set_path = os.environ.get('PYARROW_TZDATA_PATH', None)
+ if tzdata_set_path:
+ set_timezone_db_path(tzdata_set_path)
+ else:
+ if not
os.path.exists(os.path.expandvars(r"%USERPROFILE%\Downloads\tzdata")):
+ _warnings.warn('The timezone database is not installed. Timezones
'+
+ 'will not be available.', RuntimeWarning)
Review Comment:
I am not sure if I would warn on import. Because not all people need
timezone related functionality, and now everyone importing pyarrow on windows
not having downloaded the tz database will see this warning.
As long as we give a good and informative error message when you try to use
a functionality that needs this, I think that should be good enough.
(although I am not sure this is the case right now, since it will be a
generic C++ error)
--
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]