Fix test failures on 32-bit systems
authorDebian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Tue, 28 Jan 2025 22:18:06 +0000 (22:18 +0000)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Tue, 28 Jan 2025 22:18:06 +0000 (22:18 +0000)
Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Bug-Debian: partly https://bugs.debian.org/1026351
Forwarded: no

Gbp-Pq: Name tests_dont_assume_64bit.patch

pandas/tests/frame/test_stack_unstack.py
pandas/tests/groupby/test_groupby.py
pandas/tests/reshape/test_pivot.py
pandas/tests/series/methods/test_round.py
pandas/tests/test_downstream.py
pandas/tests/test_sorting.py

index d8b92091260a3b0fbde9ddd99e46d31d1fdbf320..9d61d9f41cf40f76d02b101c0682b33ade6466ab 100644 (file)
@@ -20,6 +20,7 @@ from pandas import (
 )
 import pandas._testing as tm
 from pandas.core.reshape import reshape as reshape_lib
+from pandas.compat import IS64
 
 
 @pytest.fixture(params=[True, False])
@@ -2175,6 +2176,7 @@ class TestStackUnstackMultiLevel:
         tm.assert_frame_equal(recons, df)
 
     @pytest.mark.slow
+    @pytest.mark.xfail(condition=not IS64, reason="assumes default int is int64")
     def test_unstack_number_of_levels_larger_than_int32(self, monkeypatch):
         # GH#20601
         # GH 26314: Change ValueError to PerformanceWarning
index 44d6340e55507275284a066f10950e97f795e699..8fddb14ebb7501676a0abd90e048a1189e65c332 100644 (file)
@@ -6,6 +6,7 @@ import re
 import numpy as np
 import pytest
 
+from pandas.compat import IS64
 from pandas.errors import (
     PerformanceWarning,
     SpecificationError,
@@ -2618,6 +2619,7 @@ def test_groupby_series_with_tuple_name():
     tm.assert_series_equal(result, expected)
 
 
+@pytest.mark.xfail(not IS64, reason="GH#38778: fail on 32-bit system", strict=False)
 @pytest.mark.parametrize(
     "func, values", [("sum", [97.0, 98.0]), ("mean", [24.25, 24.5])]
 )
@@ -2630,6 +2632,7 @@ def test_groupby_numerical_stability_sum_mean(func, values):
     tm.assert_frame_equal(result, expected)
 
 
+@pytest.mark.xfail(not IS64, reason="GH#38778: fail on 32-bit system", strict=False)
 def test_groupby_numerical_stability_cumsum():
     # GH#38934
     data = [1e16, 1e16, 97, 98, -5e15, -5e15, -5e15, -5e15]
index 18a449b4d0c67b55f24aa590229dddb0ed456054..fbc6185d165ea2a6c2169c52b8c6c1b4bb27c2aa 100644 (file)
@@ -28,6 +28,7 @@ import pandas._testing as tm
 from pandas.api.types import CategoricalDtype
 from pandas.core.reshape import reshape as reshape_lib
 from pandas.core.reshape.pivot import pivot_table
+from pandas.compat import IS64
 
 
 @pytest.fixture(params=[True, False])
@@ -2092,6 +2093,7 @@ class TestPivotTable:
         tm.assert_frame_equal(result, expected)
 
     @pytest.mark.slow
+    @pytest.mark.xfail(condition=not IS64, reason="assumes default int is int64")
     def test_pivot_number_of_levels_larger_than_int32(self, monkeypatch):
         # GH 20601
         # GH 26314: Change ValueError to PerformanceWarning
index c330b7a7dfbbba7f68d5da6d038e6f85f9eedcb4..a9fcaef14ce0f8809518778edc3b6579d49f4354 100644 (file)
@@ -30,8 +30,7 @@ class TestSeriesRound:
     def test_round_numpy_with_nan(self, any_float_dtype):
         # See GH#14197
         ser = Series([1.53, np.nan, 0.06], dtype=any_float_dtype)
-        with tm.assert_produces_warning(None):
-            result = ser.round()
+        result = ser.round() # on armhf, numpy warns
         expected = Series([2.0, np.nan, 0.0], dtype=any_float_dtype)
         tm.assert_series_equal(result, expected)
 
index 29991be30220fd580b4084d80cc9558fccebeeab..861aee49dbb5eaeafd2aead4f2e1559b3a47edea 100644 (file)
@@ -19,6 +19,7 @@ from pandas import (
     TimedeltaIndex,
 )
 import pandas._testing as tm
+from pandas.compat import IS64
 from pandas.core.arrays import (
     DatetimeArray,
     TimedeltaArray,
@@ -230,6 +231,11 @@ def test_missing_required_dependency():
         assert name in output
 
 
+@pytest.mark.xfail(
+    condition=not IS64,
+    reason="dask has different nativesize-int vs int64 type rules",
+    strict=False,
+)
 def test_frame_setitem_dask_array_into_new_col():
     # GH#47128
 
index 285f240028152072ed52b3657113d30a7fd63fea..18ed285ed655f5f3693b00c14b174f07862b313c 100644 (file)
@@ -4,6 +4,7 @@ from itertools import product
 
 import numpy as np
 import pytest
+from pandas.compat import IS64
 
 from pandas import (
     NA,
@@ -218,6 +219,7 @@ class TestMerge:
         assert result.name is None
 
     @pytest.mark.slow
+    @pytest.mark.xfail(condition=not IS64, reason="assumes default int is int64")
     @pytest.mark.parametrize("how", ["left", "right", "outer", "inner"])
     def test_int64_overflow_how_merge(self, left_right, how):
         left, right = left_right
@@ -228,6 +230,7 @@ class TestMerge:
         tm.assert_frame_equal(out, merge(left, right, how=how, sort=True))
 
     @pytest.mark.slow
+    @pytest.mark.xfail(condition=not IS64, reason="assumes default int is int64")
     def test_int64_overflow_sort_false_order(self, left_right):
         left, right = left_right
 
@@ -239,6 +242,7 @@ class TestMerge:
         tm.assert_frame_equal(right, out[right.columns.tolist()])
 
     @pytest.mark.slow
+    @pytest.mark.xfail(condition=not IS64, reason="assumes default int is int64", strict=False)
     @pytest.mark.parametrize("how", ["left", "right", "outer", "inner"])
     @pytest.mark.parametrize("sort", [True, False])
     def test_int64_overflow_one_to_many_none_match(self, how, sort):