-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
TST: add tests for keeping dtype in Series.update #23604
Merged
jreback
merged 19 commits into
pandas-dev:master
from
h-vetinari:tst_series_update_dtype
Nov 20, 2018
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
925237a
TST: add tests for keeping dtype in Series.update
h-vetinari 9a74273
Retrigger CI
h-vetinari 8a0a7ed
Merge remote-tracking branch 'upstream/master' into tst_series_update…
h-vetinari 3718979
Review (gfyoung)
h-vetinari 31317ea
Fix isort
h-vetinari e448675
Merge remote-tracking branch 'upstream/master' into tst_series_update…
h-vetinari 241de90
Review (jreback)
h-vetinari 528f36f
Retrigger CI after flaky hypothesis failure
h-vetinari 66b535f
Merge remote-tracking branch 'upstream/master' into tst_series_update…
h-vetinari c180b48
Review (jreback)
h-vetinari 437a025
Review (gfyoung)
h-vetinari be15e28
Remove stray print statement
h-vetinari 71655ec
Merge remote-tracking branch 'upstream/master' into tst_series_update…
h-vetinari b736c4b
Add test without try-catch for demo purposes
h-vetinari 8f78023
Lint
h-vetinari a5610a2
Easily extend dtype coverage of test with try-catch
h-vetinari 9168f4e
Lint
h-vetinari 57466dd
Merge remote-tracking branch 'upstream/master' into tst_series_update…
h-vetinari 0f50a25
Review (jreback)
h-vetinari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
pls don't use a try except inside the test itself. you should explicity use pytest.raises if you want to catch an exception
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.
@jreback
I know, but this is fully intended (I've made the same argument to @gfyoung in a conversation he marked "resolved" below).
The thing is that
Series.update
will maintain the dtype of the caller as much as it can. This means, when calling from anint
Series, floats get cast toint
, if possible. Only if that doesn't work, is the dtype changed to whatever the updated values require.If I were to pass expected results through the parametrization, I wouldn't be able to parametrize separately, and would therefore need 12 expected results. This is neither easy to read nor extensible.
Please have another look at this test, I think it's quite clear that the try-catch is not about skipping, but about different expected values (which I explained with the comment).