Skip to content

BUG: Hypothesis test failure - test_on_offset_implementations #34751

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

Closed
simonjayhawkins opened this issue Jun 13, 2020 · 1 comment · Fixed by #37376
Closed

BUG: Hypothesis test failure - test_on_offset_implementations #34751

simonjayhawkins opened this issue Jun 13, 2020 · 1 comment · Fixed by #37376
Labels
Bug Timezones Timezone data dtype Unreliable Test Unit tests that occasionally fail
Milestone

Comments

@simonjayhawkins
Copy link
Member

https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=37199&view=logs&j=76104ccd-8dcc-5006-a17c-28bcdd709542&t=cd420693-444f-5c55-14e0-1be238e189a1

2020-06-13T14:27:46.0206662Z ================================== FAILURES ===================================
2020-06-13T14:27:46.0207049Z _______________________ test_on_offset_implementations ________________________
2020-06-13T14:27:46.0207455Z [gw2] win32 -- Python 3.7.7 C:\Miniconda\envs\pandas-dev\python.exe
2020-06-13T14:27:46.0207694Z 
2020-06-13T14:27:46.0207905Z     @given(gen_random_datetime, gen_yqm_offset)
2020-06-13T14:27:46.0208239Z >   def test_on_offset_implementations(dt, offset):
2020-06-13T14:27:46.0208612Z 
2020-06-13T14:27:46.0208902Z pandas\tests\tseries\offsets\test_offsets_properties.py:89: 
2020-06-13T14:27:46.0209414Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2020-06-13T14:27:46.0209969Z pandas\tests\tseries\offsets\test_offsets_properties.py:94: in test_on_offset_implementations
2020-06-13T14:27:46.0210468Z     compare = (dt + offset) - offset
2020-06-13T14:27:46.0210950Z pandas\_libs\tslibs\offsets.pyx:438: in pandas._libs.tslibs.offsets.BaseOffset.__add__
2020-06-13T14:27:46.0211305Z     return other.__add__(self)
2020-06-13T14:27:46.0211774Z pandas\_libs\tslibs\offsets.pyx:440: in pandas._libs.tslibs.offsets.BaseOffset.__add__
2020-06-13T14:27:46.0212253Z     return self.apply(other)
2020-06-13T14:27:46.0212687Z pandas\_libs\tslibs\offsets.pyx:135: in pandas._libs.tslibs.offsets.apply_wraps.wrapper
2020-06-13T14:27:46.0213172Z     result = result.tz_localize(tz)
2020-06-13T14:27:46.0213673Z pandas\_libs\tslibs\timestamps.pyx:1258: in pandas._libs.tslibs.timestamps.Timestamp.tz_localize
2020-06-13T14:27:46.0215173Z     value = tz_localize_to_utc(np.array([self.value], dtype='i8'), tz,
2020-06-13T14:27:46.0215769Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2020-06-13T14:27:46.0216156Z 
2020-06-13T14:27:46.0216385Z >   raise pytz.NonExistentTimeError(stamp)
2020-06-13T14:27:46.0216849Z E   pytz.exceptions.NonExistentTimeError: 1906-01-01 00:00:00
2020-06-13T14:27:46.0217233Z 
2020-06-13T14:27:46.0217489Z pandas\_libs\tslibs\tzconversion.pyx:276: NonExistentTimeError
2020-06-13T14:27:46.0217864Z --------------------------------- Hypothesis ----------------------------------
2020-06-13T14:27:46.0218223Z Falsifying example: test_on_offset_implementations(
2020-06-13T14:27:46.0218570Z     dt=datetime.datetime(1900, 1, 1, 0, 0, tzinfo=tzfile('Asia/Calcutta')),
2020-06-13T14:27:46.0219018Z     offset=<72 * MonthBegins>,
2020-06-13T14:27:46.0219213Z )
@simonjayhawkins simonjayhawkins added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jun 13, 2020
@smithto1
Copy link
Member

Getting same error.

I think it is because the test adds an offset to a randomly generated date. If the randomly generated date is close max_dt adding the offset pushes it over the edge so it is not a valid value.

https://github.com/pandas-dev/pandas/blob/master/pandas/tests/tseries/offsets/test_offsets_properties.py#L93

https://github.com/pandas-dev/pandas/blob/master/pandas/tests/tseries/offsets/test_offsets_properties.py#L56

https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=39375&view=logs&j=077026cf-93c0-54aa-45e0-9996ba75f6f7&t=e95cf409-86ae-5b4d-6c5f-79395ef75e8f

================================== FAILURES ===================================
_______________________ test_on_offset_implementations ________________________
[gw0] win32 -- Python 3.6.10 C:\Miniconda\envs\pandas-dev\python.exe

    @given(gen_random_datetime, gen_yqm_offset)
>   def test_on_offset_implementations(dt, offset):

pandas\tests\tseries\offsets\test_offsets_properties.py:88: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pandas\tests\tseries\offsets\test_offsets_properties.py:93: in test_on_offset_implementations
    compare = (dt + offset) - offset
pandas\_libs\tslibs\offsets.pyx:407: in pandas._libs.tslibs.offsets.BaseOffset.__add__
    return other.__add__(self)
pandas\_libs\tslibs\offsets.pyx:409: in pandas._libs.tslibs.offsets.BaseOffset.__add__
    return self.apply(other)
pandas\_libs\tslibs\offsets.pyx:157: in pandas._libs.tslibs.offsets.apply_wraps.wrapper
    result = result.tz_localize(tz)
pandas\_libs\tslibs\timestamps.pyx:1305: in pandas._libs.tslibs.timestamps.Timestamp.tz_localize
    value = tz_localize_to_utc_single(self.value, tz,
pandas\_libs\tslibs\tzconversion.pyx:57: in pandas._libs.tslibs.tzconversion.tz_localize_to_utc_single
    return tz_localize_to_utc(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise pytz.NonExistentTimeError(stamp)

@jbrockmendel jbrockmendel added Unreliable Test Unit tests that occasionally fail Timezones Timezone data dtype and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 3, 2020
jbrockmendel added a commit to jbrockmendel/pandas that referenced this issue Oct 24, 2020
@jreback jreback added this to the 1.2 milestone Oct 24, 2020
JulianWgs pushed a commit to JulianWgs/pandas that referenced this issue Oct 26, 2020
kesmit13 pushed a commit to kesmit13/pandas that referenced this issue Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Timezones Timezone data dtype Unreliable Test Unit tests that occasionally fail
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants