Skip to content

Commit

Permalink
internals: remove invalid test
Browse files Browse the repository at this point in the history
'<M8[ns]' - '<M8[ns]' = '<m8[ns]' , other binop are invalid.
  • Loading branch information
holymonson committed Jul 22, 2018
1 parent 0dac2ee commit 8a3a20e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions pandas/core/internals/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2788,10 +2788,10 @@ def set(self, locs, values, check=False):
self.values[locs] = values

def eval(self, func, other, try_cast=False, **kwargs):
block = super().eval(func, other, try_cast=try_cast, **kwargs)[0]
block = super(DatetimeBlock, self).eval(func, other, try_cast=try_cast,
**kwargs)[0]
if try_cast:
if isinstance(other,
(tslibs.Timestamp, np.datetime64, datetime, date)):
if isinstance(other, (np.datetime64, date)):
block = TimeDeltaBlock(block.values, block.mgr_locs,
ndim=block.ndim)
elif isinstance(other, ABCDateOffset):
Expand Down
20 changes: 10 additions & 10 deletions pandas/tests/internals/test_internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,6 @@ class TestCanHoldElement(object):
(2**63, 'complex128'),
(True, 'bool'),
(np.timedelta64(20, 'ns'), '<m8[ns]'),
(np.datetime64(20, 'ns'), '<M8[ns]'),
])
@pytest.mark.parametrize('op', [
operator.add,
Expand All @@ -1249,15 +1248,16 @@ class TestCanHoldElement(object):
operator.pow,
], ids=lambda x: x.__name__)
def test_binop_other(self, op, value, dtype):
skip = {(operator.add, 'bool'),
(operator.sub, 'bool'),
(operator.mul, 'bool'),
(operator.truediv, 'bool'),
(operator.mod, 'i8'),
(operator.mod, 'complex128'),
(operator.mod, '<M8[ns]'),
(operator.mod, '<m8[ns]'),
(operator.pow, 'bool')}
skip = {
(operator.add, 'bool'),
(operator.sub, 'bool'),
(operator.mul, 'bool'),
(operator.truediv, 'bool'),
(operator.mod, 'i8'),
(operator.mod, 'complex128'),
(operator.mod, '<m8[ns]'),
(operator.pow, 'bool'),
}
if (op, dtype) in skip:
pytest.skip("Invalid combination {},{}".format(op, dtype))
e = DummyElement(value, dtype)
Expand Down

0 comments on commit 8a3a20e

Please sign in to comment.