diff --git a/python/pyarrow/tests/test_pandas.py b/python/pyarrow/tests/test_pandas.py index 676cc96151161..89a241a27efe0 100644 --- a/python/pyarrow/tests/test_pandas.py +++ b/python/pyarrow/tests/test_pandas.py @@ -2608,8 +2608,9 @@ def test_from_numpy_nested(self): ('yy', np.bool_)])), ('y', np.int16), ('z', np.object_)]) - # Note: itemsize is not a multiple of sizeof(object) - assert dt.itemsize == 12 + # Note: itemsize is not necessarily a multiple of sizeof(object) + # object_ is 8 bytes on 64-bit systems, 4 bytes on 32-bit systems + assert dt.itemsize == (12 if sys.maxsize > 2**32 else 8) ty = pa.struct([pa.field('x', pa.struct([pa.field('xx', pa.int8()), pa.field('yy', pa.bool_())])), pa.field('y', pa.int16()), diff --git a/python/pyarrow/tests/test_schema.py b/python/pyarrow/tests/test_schema.py index fa75fcea30db7..8793c9e773c1d 100644 --- a/python/pyarrow/tests/test_schema.py +++ b/python/pyarrow/tests/test_schema.py @@ -681,7 +681,8 @@ def test_schema_sizeof(): pa.field('bar', pa.string()), ]) - assert sys.getsizeof(schema) > 30 + # Note: pa.schema is twice as large on 64-bit systems + assert sys.getsizeof(schema) > (30 if sys.maxsize > 2**32 else 15) schema2 = schema.with_metadata({"key": "some metadata"}) assert sys.getsizeof(schema2) > sys.getsizeof(schema)