Skip to content

Add more overflow tests for timedelta64 operations #46854

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
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f0b34b0
add tests for existing behavior
patrickmckenna Apr 22, 2022
287ca88
note spurious overflow for single elem td64 series
patrickmckenna Apr 23, 2022
992ca95
finer-grained testing for td64 sum overflow errors
patrickmckenna Apr 23, 2022
1ea03e6
styling, ex msg fixes
patrickmckenna Apr 24, 2022
2868200
Merge remote-tracking branch 'upstream/main' into td64-sums
patrickmckenna Apr 24, 2022
eb1f61b
Merge remote-tracking branch 'upstream/main' into td64-sums
patrickmckenna Apr 24, 2022
ac91c58
consolidate, parameterize td64 addition overflow tests
patrickmckenna Apr 25, 2022
b8e4a51
add scalar multiplication tests
patrickmckenna Apr 25, 2022
4c72f1e
add tests for scalar multiplication
patrickmckenna Apr 25, 2022
5ef0a48
Merge remote-tracking branch 'upstream/main' into td64-sums
patrickmckenna Apr 25, 2022
aeef81c
mypy, win38 fixes
patrickmckenna Apr 25, 2022
438339d
use box_expected where possible
patrickmckenna Apr 25, 2022
e86d0df
Merge remote-tracking branch 'upstream/main' into td64-sums
patrickmckenna Apr 25, 2022
bd62e08
consolidate all new, some old td64 overflow tests in new module
patrickmckenna Apr 26, 2022
1424dee
remove hypothesis overuse
patrickmckenna Apr 26, 2022
3369bbc
Merge remote-tracking branch 'upstream/main' into td64-sums
patrickmckenna Apr 27, 2022
6c3b482
address PR code style feedback
patrickmckenna Apr 27, 2022
c14d0c8
put new tests back in pre-existing modules
patrickmckenna Apr 27, 2022
f2e0ba4
dedupe test setup helpers
patrickmckenna Apr 27, 2022
3f89526
Merge remote-tracking branch 'upstream/main' into td64-sums
patrickmckenna Apr 27, 2022
e03a902
obey the linting gods
patrickmckenna Apr 28, 2022
6ca60f5
Merge remote-tracking branch 'upstream/main' into td64-sums
patrickmckenna Apr 28, 2022
15ef834
adjust for platform/env-specific overflow behavior
patrickmckenna Apr 28, 2022
d4d2160
Merge remote-tracking branch 'upstream/main' into td64-sums
patrickmckenna May 3, 2022
13d198e
use newer type hint syntax
patrickmckenna May 3, 2022
b37aa4d
update tests to reflect recent changes
patrickmckenna May 3, 2022
cd59647
remove scalar-box tests, use existing fixtures
patrickmckenna May 3, 2022
05f4137
DRY up some td64 tests
patrickmckenna May 3, 2022
7a6a8cf
platform-specific fixes
patrickmckenna May 3, 2022
7ce2082
Merge branch 'main' into td64-sums
patrickmckenna May 11, 2022
24fbc09
Merge branch 'main' into td64-sums
patrickmckenna May 12, 2022
d6069d3
Merge remote-tracking branch 'upstream/main' into td64-sums
patrickmckenna May 13, 2022
2f24ec7
Merge remote-tracking branch 'upstream/main' into td64-sums
patrickmckenna May 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions pandas/_testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from datetime import datetime
from decimal import Decimal
from functools import wraps
from inspect import isclass
import operator
import os
import re
Expand Down Expand Up @@ -245,19 +246,21 @@ def box_expected(expected, box_cls, transpose=True):
Parameters
----------
expected : np.ndarray, Index, Series
box_cls : {Index, Series, DataFrame}
box_cls : {Index, Series, DataFrame, pd.array, ExtensionArray}

Returns
-------
subclass of box_cls
"""
if box_cls is pd.array:
if box_cls is pd.array or (
isclass(box_cls) and issubclass(box_cls, ExtensionArray)
):
if isinstance(expected, RangeIndex):
# pd.array would return an IntegerArray
expected = PandasArray(np.asarray(expected._values))
else:
expected = pd.array(expected)
elif box_cls is Index:
elif isclass(box_cls) and issubclass(box_cls, Index):
expected = Index._with_infer(expected)
elif box_cls is Series:
expected = Series(expected)
Expand Down
Loading