-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: regression test for groupby with datetime and timedelta (#15562) #29063
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
Conversation
pandas/tests/groupby/test_apply.py
Outdated
B,2017-02-01 00:00:00 | ||
C,2017-02-01 00:00:00""" | ||
|
||
df = pd.read_csv(StringIO(s)) |
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.
Can you construct the dataframe manually without reading it as a csv?
df = pd.DataFrame([...])
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.
sure.
pandas/tests/groupby/test_apply.py
Outdated
dict(clientid_age=ddf.time_delta_zero.min(), date=ddf.datetime.min()) | ||
) | ||
) | ||
assert result.shape == (3, 2) |
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.
Can you construct the expected dataframe and use tm.assert_frame_equal
?
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.
yes. just pushed the update.
f21c172
to
4c580c3
Compare
@mroeschke Change has been pushed. Some azure pipeline timed out. Is there a way to restart tests? Or should I re-push my branch? (update: Apparently the command/comment |
Commenter does not have sufficient privileges for PR 29063 in repo pandas-dev/pandas |
If you merge master it will run the CI (master was having problems yesterday) |
ok, ping on green. |
4c580c3
to
eb3a547
Compare
eb3a547
to
2fcf885
Compare
@jreback Tests are green |
thanks @qudade |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
This change doesn't add a new feature but adds an regression test for #15562 which has been fixed with pandas 0.20. Hence there is no whatsnew entry.
The bug was reported for pandas 0.18.1 and persisted until 0.19.2 but was fixed in 0.20.0(-rc1). I managed to reproduce the error (with
numpy==1.12.1
on python 3.6, otherwise some errors unrelated to this bug appear).I added an regression test to
pandas/tests/groupby/test_apply.py
and verified that the code will fail with 0.19.2 and succeed with 0.20.0 and master.I wasn't able to further reduce the test provided by @field-cady.