Skip to content

Commit 8a3a20e

Browse files
committed
internals: remove invalid test
'<M8[ns]' - '<M8[ns]' = '<m8[ns]' , other binop are invalid.
1 parent 0dac2ee commit 8a3a20e

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

pandas/core/internals/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2788,10 +2788,10 @@ def set(self, locs, values, check=False):
27882788
self.values[locs] = values
27892789

27902790
def eval(self, func, other, try_cast=False, **kwargs):
2791-
block = super().eval(func, other, try_cast=try_cast, **kwargs)[0]
2791+
block = super(DatetimeBlock, self).eval(func, other, try_cast=try_cast,
2792+
**kwargs)[0]
27922793
if try_cast:
2793-
if isinstance(other,
2794-
(tslibs.Timestamp, np.datetime64, datetime, date)):
2794+
if isinstance(other, (np.datetime64, date)):
27952795
block = TimeDeltaBlock(block.values, block.mgr_locs,
27962796
ndim=block.ndim)
27972797
elif isinstance(other, ABCDateOffset):

pandas/tests/internals/test_internals.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,6 @@ class TestCanHoldElement(object):
12381238
(2**63, 'complex128'),
12391239
(True, 'bool'),
12401240
(np.timedelta64(20, 'ns'), '<m8[ns]'),
1241-
(np.datetime64(20, 'ns'), '<M8[ns]'),
12421241
])
12431242
@pytest.mark.parametrize('op', [
12441243
operator.add,
@@ -1249,15 +1248,16 @@ class TestCanHoldElement(object):
12491248
operator.pow,
12501249
], ids=lambda x: x.__name__)
12511250
def test_binop_other(self, op, value, dtype):
1252-
skip = {(operator.add, 'bool'),
1253-
(operator.sub, 'bool'),
1254-
(operator.mul, 'bool'),
1255-
(operator.truediv, 'bool'),
1256-
(operator.mod, 'i8'),
1257-
(operator.mod, 'complex128'),
1258-
(operator.mod, '<M8[ns]'),
1259-
(operator.mod, '<m8[ns]'),
1260-
(operator.pow, 'bool')}
1251+
skip = {
1252+
(operator.add, 'bool'),
1253+
(operator.sub, 'bool'),
1254+
(operator.mul, 'bool'),
1255+
(operator.truediv, 'bool'),
1256+
(operator.mod, 'i8'),
1257+
(operator.mod, 'complex128'),
1258+
(operator.mod, '<m8[ns]'),
1259+
(operator.pow, 'bool'),
1260+
}
12611261
if (op, dtype) in skip:
12621262
pytest.skip("Invalid combination {},{}".format(op, dtype))
12631263
e = DummyElement(value, dtype)

0 commit comments

Comments
 (0)