-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Python] Allow setting path to timezone db through python API #35600
Comments
If I remember correctly, the problem here is that this uses a different format than what the tz implementation we use (https://howardhinnant.github.io/date/tz.html) expects. |
And the R bindings already expose this, which essentially is a small wrapper around the setting a C++ option ( Lines 38 to 47 in f6e4479
So it should certainly be possible to add a similar function to pyarrow. |
Thanks for all the work on arrow! I'm on windows and when running the following: from datetime import datetime
import pyarrow.compute as pc
pc.strftime(datetime(2004, 8, 1)) I get the following error:
Observe, that the error path refers to But in OP the following is mentioned:
But if I check: ! echo %USERPROFILE%
and from pathlib import Path
Path.home()
It is both linking to I assume it is just early days and this user experience will improve soon. |
@mattijn what does |
So then the error message could be expected? On the C++ side, it is using |
Yes. The error message is right indeed, C++ gets the right location using |
…PI (#37436) ### Rationale for this change Add a function to change the path where timezone db should be found as a small wrapper around the setting of a C++ option `GlobalOptions`. ### What changes are included in this PR? New function `configure_tzdb`. ### Are these changes tested? ### Are there any user-facing changes? No. * Closes: #35600 Lead-authored-by: AlenkaF <frim.alenka@gmail.com> Co-authored-by: Antoine Pitrou <pitrou@free.fr> Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com> Co-authored-by: Sutou Kouhei <kou@cozmixng.org> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
…nstall docs (#38146) ### What changes are included in this PR? The option to set custom path to timezone database through python API has been implemented in #35600 and is documented in `docs/source/python/install.rst` with this PR. * Closes: #38145 Authored-by: AlenkaF <frim.alenka@gmail.com> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
…thon API (apache#37436) ### Rationale for this change Add a function to change the path where timezone db should be found as a small wrapper around the setting of a C++ option `GlobalOptions`. ### What changes are included in this PR? New function `configure_tzdb`. ### Are these changes tested? ### Are there any user-facing changes? No. * Closes: apache#35600 Lead-authored-by: AlenkaF <frim.alenka@gmail.com> Co-authored-by: Antoine Pitrou <pitrou@free.fr> Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com> Co-authored-by: Sutou Kouhei <kou@cozmixng.org> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
…thon install docs (apache#38146) ### What changes are included in this PR? The option to set custom path to timezone database through python API has been implemented in apache#35600 and is documented in `docs/source/python/install.rst` with this PR. * Closes: apache#38145 Authored-by: AlenkaF <frim.alenka@gmail.com> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
…thon API (apache#37436) ### Rationale for this change Add a function to change the path where timezone db should be found as a small wrapper around the setting of a C++ option `GlobalOptions`. ### What changes are included in this PR? New function `configure_tzdb`. ### Are these changes tested? ### Are there any user-facing changes? No. * Closes: apache#35600 Lead-authored-by: AlenkaF <frim.alenka@gmail.com> Co-authored-by: Antoine Pitrou <pitrou@free.fr> Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com> Co-authored-by: Sutou Kouhei <kou@cozmixng.org> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
…thon install docs (apache#38146) ### What changes are included in this PR? The option to set custom path to timezone database through python API has been implemented in apache#35600 and is documented in `docs/source/python/install.rst` with this PR. * Closes: apache#38145 Authored-by: AlenkaF <frim.alenka@gmail.com> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
…thon API (apache#37436) ### Rationale for this change Add a function to change the path where timezone db should be found as a small wrapper around the setting of a C++ option `GlobalOptions`. ### What changes are included in this PR? New function `configure_tzdb`. ### Are these changes tested? ### Are there any user-facing changes? No. * Closes: apache#35600 Lead-authored-by: AlenkaF <frim.alenka@gmail.com> Co-authored-by: Antoine Pitrou <pitrou@free.fr> Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com> Co-authored-by: Sutou Kouhei <kou@cozmixng.org> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
…thon install docs (apache#38146) ### What changes are included in this PR? The option to set custom path to timezone database through python API has been implemented in apache#35600 and is documented in `docs/source/python/install.rst` with this PR. * Closes: apache#38145 Authored-by: AlenkaF <frim.alenka@gmail.com> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Describe the enhancement requested
The timezone DB is required to be at %USERPROFILE%\Downloads\tzdata in pyarrow on windows. It would be nice to have a python API to change the path where this db should be found, I believe this is currently only possible through the C++ implementation using arrow:initialize.
It would also be nice if the timezone db was not required if tzdata/pytz are installed.
Component(s)
Python
The text was updated successfully, but these errors were encountered: