|
26 | 26 |
|
27 | 27 |
|
28 | 28 | dtypes_mcclear_verbose = [ |
29 | | - 'object', 'float64', 'float64', 'float64', 'float64', 'float64', 'float64', |
| 29 | + # None indicates string, which differs between pandas 2 and 3 |
| 30 | + None, 'float64', 'float64', 'float64', 'float64', 'float64', 'float64', |
30 | 31 | 'float64', 'float64', 'float64', 'float64', 'float64', 'float64', |
31 | 32 | 'float64', 'float64', 'float64', 'float64', 'float64', 'int64', 'float64', |
32 | 33 | 'float64', 'float64', 'float64'] |
33 | 34 |
|
34 | 35 | dtypes_mcclear = [ |
35 | | - 'object', 'float64', 'float64', 'float64', 'float64', 'float64'] |
| 36 | + # None indicates string, which differs between pandas 2 and 3 |
| 37 | + None, 'float64', 'float64', 'float64', 'float64', 'float64'] |
36 | 38 |
|
37 | 39 | dtypes_radiation_verbose = [ |
38 | | - 'object', 'float64', 'float64', 'float64', 'float64', 'float64', 'float64', |
| 40 | + # None indicates string, which differs between pandas 2 and 3 |
| 41 | + None, 'float64', 'float64', 'float64', 'float64', 'float64', 'float64', |
39 | 42 | 'float64', 'float64', 'float64', 'float64', 'float64', 'float64', |
40 | 43 | 'float64', 'float64', 'float64', 'float64', 'float64', 'float64', |
41 | 44 | 'float64', 'float64', 'float64', 'float64', 'int64', 'float64', 'float64', |
42 | 45 | 'float64', 'float64', 'float64', 'int64', 'int64', 'float64', 'float64', |
43 | 46 | 'float64', 'float64'] |
44 | 47 |
|
45 | 48 | dtypes_radiation = [ |
46 | | - 'object', 'float64', 'float64', 'float64', 'float64', 'float64', 'float64', |
| 49 | + # None indicates string, which differs between pandas 2 and 3 |
| 50 | + None, 'float64', 'float64', 'float64', 'float64', 'float64', 'float64', |
47 | 51 | 'float64', 'float64', 'float64', 'float64'] |
48 | 52 |
|
49 | 53 |
|
@@ -154,7 +158,9 @@ def generate_expected_dataframe(values, columns, index, dtypes): |
154 | 158 | expected = pd.DataFrame(values, columns=columns, index=index) |
155 | 159 | expected.index.freq = None |
156 | 160 | for (col, _dtype) in zip(expected.columns, dtypes): |
157 | | - expected[col] = expected[col].astype(_dtype) |
| 161 | + if _dtype is not None: |
| 162 | + # for None (string), use inferred type for pandas 2/3 compat |
| 163 | + expected[col] = expected[col].astype(_dtype) |
158 | 164 | return expected |
159 | 165 |
|
160 | 166 |
|
|
0 commit comments