| 1 |
From: Colin Watson <[email protected]> |
| 2 |
Date: Wed, 16 Apr 2025 02:11:24 +0100 |
| 3 |
Subject: Fix test_multindex_dataframe_roundtrip on 32-bit architectures |
| 4 |
|
| 5 |
https://bugs.debian.org/1103146 reports that this test is failing on |
| 6 |
Debian's i386 architecture, and |
| 7 |
https://ci.debian.net/packages/j/jsonpickle/ shows that it has been |
| 8 |
failing on all 32-bit architectures for some time. The reason is buried |
| 9 |
many levels deep, but it turns out that |
| 10 |
`pandas.core.indexes.base.Index._with_infer` converts the index levels |
| 11 |
to `np.int64` even if they were initially of a narrower integer type - |
| 12 |
so it seems to make most sense to start them out as `np.int64` as well. |
| 13 |
|
| 14 |
Forwarded: https://github.com/jsonpickle/jsonpickle/pull/560 |
| 15 |
Bug-Debian: https://bugs.debian.org/1103146 |
| 16 |
Last-Update: 2025-04-16 |
| 17 |
--- |
| 18 |
tests/pandas_test.py | 2 +- |
| 19 |
1 file changed, 1 insertion(+), 1 deletion(-) |
| 20 |
|
| 21 |
diff --git a/tests/pandas_test.py b/tests/pandas_test.py |
| 22 |
index 9ec968f..ba76b0d 100644 |
| 23 |
--- a/tests/pandas_test.py |
| 24 |
+++ b/tests/pandas_test.py |
| 25 |
@@ -99,7 +99,7 @@ def test_multindex_dataframe_roundtrip(): |
| 26 |
df = pd.DataFrame( |
| 27 |
{ |
| 28 |
'idx_lvl0': ['a', 'b', 'c'], |
| 29 |
- 'idx_lvl1': np.int_([1, 1, 2]), |
| 30 |
+ 'idx_lvl1': np.int64([1, 1, 2]), |
| 31 |
'an_int': np.int_([1, 2, 3]), |
| 32 |
'a_float': np.float64([2.5, 3.5, 4.5]), |
| 33 |
'a_nan': np.array([np.nan] * 3), |