-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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][CI] Hypothesis nightly test fails with pytz.exceptions.UnknownTimeZoneError: 'build/etc/localtime' #36349
Comments
@jorisvandenbossche any idea on that one? I am not sure why it tries to use |
No, I looked at the traceback a while ago (it's already failing longer than 5 days), and honestly no idea how this can happen or where this comes from .. The test is using the |
So actually, just trying that out, this string works for >>> import datetime
>>> import zoneinfo
>>> "build/etc/localtime" in zoneinfo.available_timezones()
True
>>> tz = zoneinfo.ZoneInfo("build/etc/localtime")
>>> tz
zoneinfo.ZoneInfo(key='build/etc/localtime')
>>> tz.key
'build/etc/localtime'
>>> tz.utcoffset(datetime.datetime.now())
datetime.timedelta(0)
>>> print(datetime.datetime.now().replace(tzinfo=tz))
2023-06-28 18:19:13.737991+00:00 So probably this timezone gets created by the zoneinfo hypothesis strategy, but we still always use pytz timezones for export (there is an issue about stopping to do this), and then pytz doesn't recognize is: >>> pa.lib.tzinfo_to_string(tz)
'build/etc/localtime'
>>> pa.lib.string_to_tzinfo("build/etc/localtime")
...
UnknownTimeZoneError: 'build/etc/localtime' which comes from >>> pytz.timezone("build/etc/localtime")
>>>
UnknownTimeZoneError: 'build/etc/localtime' I think the question is what we should do with such a |
So the "build/etc/localtime" is an actual file in my tzdata directory (base path from And the Maybe the best path forward is to disallow this timezone? (although in general we don't really check if the timezone provided by the user is correct, i.e. is a fixed offset or valid Olsen zone name) Or short term for this test, skip it in case the timezone is this 'build/etc/localtime' |
…ne in hypothesis tests
…hypothesis tests (#36391) ### What changes are included in this PR? Skip the test if the timezone is `zoneinfo.ZoneInfo(key='build/etc/localtime')`, because we don't support roundtripping such a timezone * Closes: #36349 Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
Describe the bug, including details regarding any error messages, version, and platform.
During the last 5 days the
test_python_datetime_with_pytz_timezone
on test-conda-python-3.11-hypothesis has been failing with the following error:I have been NOT able to reproduce locally with:
PYTHON=3.11 PYARROW_TEST_HYPOTHESIS="ON" PYTEST_ARGS="-m hypothesis" docker-compose run --rm conda-python-pandas
Component(s)
Continuous Integration, Python
The text was updated successfully, but these errors were encountered: