Skip to content

Commit 11dccee

Browse files
committed
BF: skip equivalence test for itemsize and nbytes if "values" ndarray view of type object
1 parent 9d67817 commit 11dccee

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/tests/indexes/common.py

+7
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ def test_ndarray_compat_properties(self):
127127

128128
values = idx.values
129129
for prop in self._compat_props:
130+
# skip equivalency check if converted type is object, as happens
131+
# for PeriodIndex, since then object (address) would be 4 bytes
132+
# on 32bit platforms and equivalence to int64 of original
133+
# date time is just accidental
134+
if prop in ('itemsize', 'nbytes') \
135+
and values.dtype.name == 'object':
136+
continue
130137
self.assertEqual(getattr(idx, prop), getattr(values, prop))
131138

132139
# test for validity

0 commit comments

Comments
 (0)