-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Fix a bug in 'timedelta_range' that produced an extra point on a edge case (fix #30353) #33498
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
Changes from all commits
a40ceb8
cab7618
42caac6
95c9e2b
7fa229b
614394a
8f8b963
b73b537
bd7e802
5a7d101
2959ce6
b706a0a
af00e90
c0bbbc5
58dfae0
2469986
71438d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -10,7 +10,7 @@ | |||
from pandas.core.groupby.grouper import Grouper | ||||
from pandas.core.indexes.datetimes import date_range | ||||
from pandas.core.indexes.period import PeriodIndex, period_range | ||||
from pandas.core.indexes.timedeltas import TimedeltaIndex, timedelta_range | ||||
from pandas.core.indexes.timedeltas import timedelta_range | ||||
from pandas.core.resample import _asfreq_compat | ||||
|
||||
# a fixture value can be overridden by the test parameter value. Note that the | ||||
|
@@ -182,7 +182,6 @@ def test_resample_size_empty_dataframe(freq, empty_frame_dti): | |||
@pytest.mark.parametrize("index", tm.all_timeseries_index_generator(0)) | ||||
@pytest.mark.parametrize("dtype", [np.float, np.int, np.object, "datetime64[ns]"]) | ||||
def test_resample_empty_dtypes(index, dtype, resample_method): | ||||
|
||||
# Empty series were sometimes causing a segfault (for the functions | ||||
# with Cython bounds-checking disabled) or an IndexError. We just run | ||||
# them to ensure they no longer do. (GH #10228) | ||||
|
@@ -215,13 +214,7 @@ def test_resample_loffset_arg_type(frame, create_index, arg): | |||
if isinstance(arg, list): | ||||
expected.columns = pd.MultiIndex.from_tuples([("value", "mean")]) | ||||
|
||||
# GH 13022, 7687 - TODO: fix resample w/ TimedeltaIndex | ||||
if isinstance(expected.index, TimedeltaIndex): | ||||
msg = "DataFrame are different" | ||||
with pytest.raises(AssertionError, match=msg): | ||||
tm.assert_frame_equal(result_agg, expected) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so this is testing incorrect behavior? thats pretty weird There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jbrockmendel Yeah, that was the case. That was testing an incorrect behavior... 😕 And this was the case for two reasons:
Here an example of the values when setting a breakpoint with PyCharm line 222 in The expected result (with The actual result (without I think that was the reason of the presence of this TODO: pandas/pandas/tests/resample/test_base.py Line 218 in 3d4f9dc
IMO, the presence of this |
||||
else: | ||||
tm.assert_frame_equal(result_agg, expected) | ||||
tm.assert_frame_equal(result_agg, expected) | ||||
hasB4K marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
|
||||
@all_ts | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope this is okay @WillAyd 🙂. I'll be happy to change this if you disagree with this changelog.
BTW, regarding
loffset
, as mentioned earlier (https://github.com/pandas-dev/pandas/pull/33498/files#r407231964):