-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TST: fix _most_ remaining xfails in tests/arithmetic #23308
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
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f7ae444
remove unused errors kwarg
jbrockmendel cdb7c5f
Make strict copies for xfailed tests
jbrockmendel 3117c8e
Fix RangeIndex with DataFrame op to return NotImplemented
jbrockmendel 1354fce
Fix reversed ops with np.timedelta64 and Tick
jbrockmendel f0c280d
update xfails
jbrockmendel 28e588b
update to more specific xfail
jbrockmendel 50c4c96
Implement transpose option for box_expected
jbrockmendel c4285a7
use transpose=True to fix many xfails
jbrockmendel a794865
use transpose in box_expected to fix most remaining xfails
jbrockmendel 370c877
flake8 fixup
jbrockmendel 870862c
fix incorrectly-xfailed test
jbrockmendel cb3109f
tests for RangeIndex returning NotImplemented
jbrockmendel 430c3f7
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel 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 hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,8 @@ | |
ABCIndex, ABCIndexClass, | ||
ABCSparseSeries, ABCSparseArray) | ||
|
||
from pandas.tseries.offsets import Tick | ||
|
||
|
||
# ----------------------------------------------------------------------------- | ||
# Ops Wrapping Utilities | ||
|
@@ -125,11 +127,16 @@ def maybe_upcast_for_op(obj): | |
Be careful to call this *after* determining the `name` attribute to be | ||
attached to the result of the arithmetic operation. | ||
""" | ||
if type(obj) is datetime.timedelta: | ||
if type(obj) is datetime.timedelta or isinstance(obj, Tick): | ||
# GH#22390 cast up to Timedelta to rely on Timedelta | ||
# implementation; otherwise operation against numeric-dtype | ||
# raises TypeError | ||
return pd.Timedelta(obj) | ||
elif isinstance(obj, np.timedelta64): | ||
# In particular non-nanosecond timedelta64 needs to be cast to | ||
# nanoseconds, or else we get undesired behavior like | ||
# np.timedelta64(3, 'D') / 2 == np.timedelta64(1, 'D') | ||
return pd.Timedelta(obj) | ||
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. FIXME: this will screw up on np.timedelta64(“nat”) |
||
elif isinstance(obj, np.ndarray) and is_timedelta64_dtype(obj): | ||
# GH#22390 Unfortunately we need to special-case right-hand | ||
# timedelta64 dtypes because numpy casts integer dtypes to | ||
|
@@ -1940,8 +1947,7 @@ def f(self, other): | |
|
||
# straight boolean comparisons we want to allow all columns | ||
# (regardless of dtype to pass thru) See #4537 for discussion. | ||
res = self._combine_const(other, func, | ||
errors='ignore') | ||
res = self._combine_const(other, func) | ||
return res.fillna(True).astype(bool) | ||
|
||
f.__name__ = op_name | ||
|
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.