File: test_multindex_dataframe_roundtrip-32bit.patch

package info (click to toggle)
jsonpickle 4.0.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,864 kB
  • sloc: python: 6,788; javascript: 654; makefile: 125; sh: 68
file content (33 lines) | stat: -rw-r--r-- 1,370 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From: Colin Watson <cjwatson@debian.org>
Date: Wed, 16 Apr 2025 02:11:24 +0100
Subject: Fix test_multindex_dataframe_roundtrip on 32-bit architectures

https://bugs.debian.org/1103146 reports that this test is failing on
Debian's i386 architecture, and
https://ci.debian.net/packages/j/jsonpickle/ shows that it has been
failing on all 32-bit architectures for some time.  The reason is buried
many levels deep, but it turns out that
`pandas.core.indexes.base.Index._with_infer` converts the index levels
to `np.int64` even if they were initially of a narrower integer type -
so it seems to make most sense to start them out as `np.int64` as well.

Forwarded: https://github.com/jsonpickle/jsonpickle/pull/560
Bug-Debian: https://bugs.debian.org/1103146
Last-Update: 2025-04-16
---
 tests/pandas_test.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/pandas_test.py b/tests/pandas_test.py
index 9ec968f..ba76b0d 100644
--- a/tests/pandas_test.py
+++ b/tests/pandas_test.py
@@ -99,7 +99,7 @@ def test_multindex_dataframe_roundtrip():
     df = pd.DataFrame(
         {
             'idx_lvl0': ['a', 'b', 'c'],
-            'idx_lvl1': np.int_([1, 1, 2]),
+            'idx_lvl1': np.int64([1, 1, 2]),
             'an_int': np.int_([1, 2, 3]),
             'a_float': np.float64([2.5, 3.5, 4.5]),
             'a_nan': np.array([np.nan] * 3),