Skip to content

Commit 1ff5245

Browse files
committed
test(parser): update expected results for overflow tests
1 parent 0d61b8d commit 1ff5245

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

pandas/tests/io/parser/common/test_ints.py

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,22 @@ def test_int64_overflow(all_parsers, conv, request):
144144
if parser.engine == "pyarrow":
145145
mark = pytest.mark.xfail(reason="parses to float64")
146146
request.applymarker(mark)
147+
elif parser.engine == "python":
148+
mark = pytest.mark.xfail(
149+
reason="TODO: Python engine reads bigint as string"
150+
)
151+
request.applymarker(mark)
147152

148153
result = parser.read_csv(StringIO(data))
149154
expected = DataFrame(
150155
[
151-
"00013007854817840016671868",
152-
"00013007854817840016749251",
153-
"00013007854817840016754630",
154-
"00013007854817840016781876",
155-
"00013007854817840017028824",
156-
"00013007854817840017963235",
157-
"00013007854817840018860166",
156+
13007854817840016671868,
157+
13007854817840016749251,
158+
13007854817840016754630,
159+
13007854817840016781876,
160+
13007854817840017028824,
161+
13007854817840017963235,
162+
13007854817840018860166,
158163
],
159164
columns=["ID"],
160165
)
@@ -185,7 +190,7 @@ def test_int64_overflow(all_parsers, conv, request):
185190
)
186191
def test_int64_uint64_range(all_parsers, val):
187192
# These numbers fall right inside the int64-uint64
188-
# range, so they should be parsed as string.
193+
# range, so they should be parsed as integer.
189194
parser = all_parsers
190195
result = parser.read_csv(StringIO(str(val)), header=None)
191196

@@ -197,13 +202,17 @@ def test_int64_uint64_range(all_parsers, val):
197202
@pytest.mark.parametrize(
198203
"val", [np.iinfo(np.uint64).max + 1, np.iinfo(np.int64).min - 1]
199204
)
200-
def test_outside_int64_uint64_range(all_parsers, val):
205+
def test_outside_int64_uint64_range(all_parsers, val, request):
201206
# These numbers fall just outside the int64-uint64
202-
# range, so they should be parsed as string.
207+
# range, so they should be parsed as object.
203208
parser = all_parsers
209+
if parser.engine == "python":
210+
mark = pytest.mark.xfail(reason="TODO: Python engine reads bigint as string")
211+
request.applymarker(mark)
212+
204213
result = parser.read_csv(StringIO(str(val)), header=None)
205214

206-
expected = DataFrame([str(val)])
215+
expected = DataFrame([val])
207216
tm.assert_frame_equal(result, expected)
208217

209218

0 commit comments

Comments
 (0)