AlenkaF commented on code in PR #38179:
URL: https://github.com/apache/arrow/pull/38179#discussion_r1431430810


##########
python/pyarrow/util.py:
##########
@@ -228,3 +228,40 @@ def _break_traceback_cycle_from_frame(frame):
         # us visit the outer frame).
         refs = gc.get_referrers(frame)
     refs = frame = this_frame = None
+
+
+def download_tzdata_on_windows():
+    """
+    Download and extract 2021e IANA timezone database into
+    the expected location in the Downloads directory.
+    """
+    if sys.platform != 'win32':
+        raise TypeError(f"Timezone database is already provided by 
{sys.platform}")
+
+    import requests
+    import tarfile
+
+    tzdata_path = os.path.expandvars(r"%USERPROFILE%\Downloads\tzdata")
+    tzdata_compressed = os.path.join(tzdata_path, "tzdata.tar.gz")
+    os.makedirs(tzdata_path, exist_ok=True)
+
+    response = requests.get(
+        'https://data.iana.org/time-zones/releases/tzdata2021e.tar.gz',

Review Comment:
   This would probably be 
'https://data.iana.org/time-zones/tzdata-latest.tar.gz'. I am not sure if it 
needs to be 2021 version as in our docs: 
https://arrow.apache.org/docs/dev/cpp/build_system.html#runtime-dependencies 
though.
   
   Ah, looking at the [PR that implemented the db for WIndows in the first 
place](https://github.com/apache/arrow/pull/12536/files#r832697782), I see the 
version was set without a specific reason so I guess we can change it for 
latest (in the docs also) 👍 



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