MCPcopy Create free account
hub / github.com/apache/arrow / test_invalid_csv

Method test_invalid_csv

python/pyarrow/tests/test_csv.py:1492–1502  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1490 }
1491
1492 def test_invalid_csv(self):
1493 # Various CSV errors
1494 rows = b"a,b,c\n1,2\n4,5,6\n"
1495 with pytest.raises(pa.ArrowInvalid, match="Expected 3 columns, got 2"):
1496 self.read_bytes(rows)
1497 rows = b"a,b,c\n1,2,3\n4"
1498 with pytest.raises(pa.ArrowInvalid, match="Expected 3 columns, got 1"):
1499 self.read_bytes(rows)
1500 for rows in [b"", b"\n", b"\r\n", b"\r", b"\n\n"]:
1501 with pytest.raises(pa.ArrowInvalid, match="Empty CSV file"):
1502 self.read_bytes(rows)
1503
1504 def test_options_delimiter(self):
1505 rows = b"a;b,c\nde,fg;eh\n"

Callers

nothing calls this directly

Calls 1

read_bytesMethod · 0.95

Tested by

no test coverage detected