Skip to content

Commit 3e1a991

Browse files
committed
test(parser): add test with overflow followed by str
1 parent 6cfc8b8 commit 3e1a991

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,19 @@ def test_outside_int64_uint64_range(all_parsers, val, request):
216216
tm.assert_frame_equal(result, expected)
217217

218218

219+
@skip_pyarrow # CSV parse error: Empty CSV file or block
220+
@pytest.mark.parametrize(
221+
"val", [np.iinfo(np.uint64).max + 1, np.iinfo(np.int64).min - 1]
222+
)
223+
def test_outside_int64_uint64_range_follow_str(all_parsers, val, request):
224+
parser = all_parsers
225+
226+
result = parser.read_csv(StringIO(f"{val}\nabc"), header=None)
227+
228+
expected = DataFrame([str(val), "abc"])
229+
tm.assert_frame_equal(result, expected)
230+
231+
219232
@xfail_pyarrow # gets float64 dtype instead of object
220233
@pytest.mark.parametrize("exp_data", [[str(-1), str(2**63)], [str(2**63), str(-1)]])
221234
def test_numeric_range_too_wide(all_parsers, exp_data):

0 commit comments

Comments
 (0)