Skip to content

Commit 848ce49

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

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/tests/indexes/common.py

+6
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ 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') and values.dtype.name == 'object':
135+
continue
130136
self.assertEqual(getattr(idx, prop), getattr(values, prop))
131137

132138
# test for validity

0 commit comments

Comments
 (0)