Skip to content

Commit 1037f19

Browse files
committed
32-bit issues in test/series/reshape/resample/window
1 parent c17dee1 commit 1037f19

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

pandas/tests/indexing/test_loc.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def test_loc_to_fail(self):
436436
)
437437

438438
msg = (
439-
r"\"None of \[NumericIndex\(\[1, 2\], dtype='int64'\)\] are "
439+
rf"\"None of \[NumericIndex\(\[1, 2\], dtype='{np.intp().dtype}'\)\] are "
440440
r"in the \[index\]\""
441441
)
442442
with pytest.raises(KeyError, match=msg):
@@ -454,7 +454,7 @@ def test_loc_to_fail2(self):
454454
s.loc[-1]
455455

456456
msg = (
457-
r"\"None of \[NumericIndex\(\[-1, -2\], dtype='int64'\)\] are "
457+
fr"\"None of \[NumericIndex\(\[-1, -2\], dtype='{np.intp().dtype}'\)\] are "
458458
r"in the \[index\]\""
459459
)
460460
with pytest.raises(KeyError, match=msg):
@@ -470,7 +470,7 @@ def test_loc_to_fail2(self):
470470

471471
s["a"] = 2
472472
msg = (
473-
r"\"None of \[NumericIndex\(\[-2\], dtype='int64'\)\] are "
473+
fr"\"None of \[NumericIndex\(\[-2\], dtype='{np.intp().dtype}'\)\] are "
474474
r"in the \[index\]\""
475475
)
476476
with pytest.raises(KeyError, match=msg):
@@ -487,7 +487,7 @@ def test_loc_to_fail3(self):
487487
df = DataFrame([["a"], ["b"]], index=[1, 2], columns=["value"])
488488

489489
msg = (
490-
r"\"None of \[NumericIndex\(\[3\], dtype='int64'\)\] are "
490+
fr"\"None of \[NumericIndex\(\[3\], dtype='{np.intp().dtype}'\)\] are "
491491
r"in the \[index\]\""
492492
)
493493
with pytest.raises(KeyError, match=msg):
@@ -507,7 +507,7 @@ def test_loc_getitem_list_with_fail(self):
507507
with pytest.raises(
508508
KeyError,
509509
match=re.escape(
510-
"\"None of [NumericIndex([3], dtype='int64')] are in the [index]\""
510+
f"\"None of [NumericIndex([3], dtype='{np.intp().dtype}')] are in the [index]\""
511511
),
512512
):
513513
s.loc[[3]]
@@ -1213,7 +1213,7 @@ def test_loc_setitem_empty_append_raises(self):
12131213
df = DataFrame(columns=["x", "y"])
12141214
df.index = df.index.astype(np.int64)
12151215
msg = (
1216-
r"None of \[NumericIndex\(\[0, 1\], dtype='int64'\)\] "
1216+
fr"None of \[NumericIndex\(\[0, 1\], dtype='{np.intp().dtype}'\)\] "
12171217
r"are in the \[index\]"
12181218
)
12191219
with pytest.raises(KeyError, match=msg):

pandas/tests/indexing/test_partial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ def test_series_partial_set(self):
403403

404404
# raises as nothing is in the index
405405
msg = (
406-
r"\"None of \[NumericIndex\(\[3, 3, 3\], dtype='int64'\)\] are "
406+
fr"\"None of \[NumericIndex\(\[3, 3, 3\], dtype='{np.intp().dtype}'\)\] are "
407407
r"in the \[index\]\""
408408
)
409409
with pytest.raises(KeyError, match=msg):
@@ -484,7 +484,7 @@ def test_series_partial_set_with_name(self):
484484

485485
# raises as nothing is in the index
486486
msg = (
487-
r"\"None of \[NumericIndex\(\[3, 3, 3\], dtype='int64', "
487+
fr"\"None of \[NumericIndex\(\[3, 3, 3\], dtype='{np.intp().dtype}', "
488488
r"name='idx'\)\] are in the \[index\]\""
489489
)
490490
with pytest.raises(KeyError, match=msg):

pandas/tests/resample/test_resampler_grouper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def test_resample_groupby_with_label():
316316
result = df.groupby("col0").resample("1W", label="left").sum()
317317

318318
mi = [
319-
np.array([0, 0, 1, 2]),
319+
np.array([0, 0, 1, 2], dtype=np.int64),
320320
pd.to_datetime(
321321
np.array(["1999-12-26", "2000-01-02", "2000-01-02", "2000-01-02"])
322322
),

pandas/tests/reshape/test_crosstab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def test_crosstab_non_aligned(self):
112112
# GH 17005
113113
a = Series([0, 1, 1], index=["a", "b", "c"])
114114
b = Series([3, 4, 3, 4, 3], index=["a", "b", "c", "d", "f"])
115-
c = np.array([3, 4, 3])
115+
c = np.array([3, 4, 3], dtype=np.int64)
116116

117117
expected = DataFrame(
118118
[[1, 0], [1, 1]],

pandas/tests/series/methods/test_reindex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def test_reindex_pad():
126126
reindexed2 = s2.reindex(s.index, method="ffill")
127127
tm.assert_series_equal(reindexed, reindexed2)
128128

129-
expected = Series([0, 0, 2, 2, 4, 4, 6, 6, 8, 8], index=np.arange(10))
129+
expected = Series([0, 0, 2, 2, 4, 4, 6, 6, 8, 8])
130130
tm.assert_series_equal(reindexed, expected)
131131

132132
# GH4604

pandas/tests/series/test_constructors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ def test_construction_interval(self, interval_constructor):
11991199
# construction from interval & array of intervals
12001200
intervals = interval_constructor.from_breaks(np.arange(3), closed="right")
12011201
result = Series(intervals)
1202-
assert result.dtype == "interval[int64, right]"
1202+
assert result.dtype == f"interval[{np.intp().dtype}, right]"
12031203
tm.assert_index_equal(Index(result.values), Index(intervals))
12041204

12051205
@pytest.mark.parametrize(

pandas/tests/series/test_repr.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def test_categorical_series_repr(self):
322322
assert repr(s) == exp
323323

324324
s = Series(Categorical(np.arange(10)))
325-
exp = """0 0
325+
exp = f"""0 0
326326
1 1
327327
2 2
328328
3 3
@@ -333,7 +333,7 @@ def test_categorical_series_repr(self):
333333
8 8
334334
9 9
335335
dtype: category
336-
Categories (10, int64): [0, 1, 2, 3, ..., 6, 7, 8, 9]"""
336+
Categories (10, {np.intp().dtype}): [0, 1, 2, 3, ..., 6, 7, 8, 9]"""
337337

338338
assert repr(s) == exp
339339

@@ -348,7 +348,7 @@ def test_categorical_series_repr_ordered(self):
348348
assert repr(s) == exp
349349

350350
s = Series(Categorical(np.arange(10), ordered=True))
351-
exp = """0 0
351+
exp = f"""0 0
352352
1 1
353353
2 2
354354
3 3
@@ -359,7 +359,7 @@ def test_categorical_series_repr_ordered(self):
359359
8 8
360360
9 9
361361
dtype: category
362-
Categories (10, int64): [0 < 1 < 2 < 3 ... 6 < 7 < 8 < 9]"""
362+
Categories (10, {np.intp().dtype}): [0 < 1 < 2 < 3 ... 6 < 7 < 8 < 9]"""
363363

364364
assert repr(s) == exp
365365

pandas/tests/window/test_groupby.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ def test_groupby_rolling_var(self, window, min_periods, closed, expected):
811811
expected_result = DataFrame(
812812
np.array(expected, dtype="float64"),
813813
index=MultiIndex(
814-
levels=[[1, 2], [0, 1, 2, 3, 4, 5, 6, 7]],
814+
levels=[np.array([1, 2]), [0, 1, 2, 3, 4, 5, 6, 7]],
815815
codes=[[0, 0, 0, 0, 1, 1, 1, 1], [0, 2, 4, 6, 1, 3, 5, 7]],
816816
),
817817
)

0 commit comments

Comments
 (0)