Skip to content

BUG: OutOfBoundsTimedelta not raised for out-of-bounds Timedelta #42235

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

Merged
merged 4 commits into from
Jul 13, 2021

Conversation

feefladder
Copy link
Contributor

@jreback jreback changed the title BUG: added test #36615 BUG: OutOfBoundsTimedelta not raised for out-of-bounds Timedelta Jun 25, 2021
@jreback jreback added Timedelta Timedelta data type Testing pandas testing functions or related to the test suite labels Jun 25, 2021
@jreback jreback added this to the 1.4 milestone Jun 25, 2021
@@ -37,3 +39,9 @@ def test_huge_nanoseconds_overflow():
# GH 32402
assert delta_to_nanoseconds(Timedelta(1e10)) == 1e10
assert delta_to_nanoseconds(Timedelta(nanoseconds=1e10)) == 1e10


def test_out_of_bounds():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should go in pandas.tests.scalar.timedelta.test_constructors

@@ -204,15 +204,26 @@ def test_overflow_on_construction():
Timedelta(timedelta(days=13 * 19999))


def test_construction_out_of_bounds_td64():
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was already here and should have caught #36615.
I parametrized it, but this is still a bit puzzling

@jreback
Copy link
Contributor

jreback commented Jul 4, 2021

can you merge master

@jreback
Copy link
Contributor

jreback commented Jul 13, 2021

@jbrockmendel ok here

@jbrockmendel
Copy link
Member

LGTM

@jreback jreback merged commit 8de8e92 into pandas-dev:master Jul 13, 2021
@jreback
Copy link
Contributor

jreback commented Jul 13, 2021

thanks @joeperdefloep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: OutOfBoundsTimedelta not raised for out-of-bounds Timedelta
3 participants