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

Method test_empty_lines

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

Source from the content-addressed store, hash-verified

1469 assert table.to_pydict() == {'': []}
1470
1471 def test_empty_lines(self):
1472 rows = b"a,b\n\r1,2\r\n\r\n3,4\r\n"
1473 table = self.read_bytes(rows)
1474 assert table.to_pydict() == {
1475 'a': [1, 3],
1476 'b': [2, 4],
1477 }
1478 parse_options = ParseOptions(ignore_empty_lines=False)
1479 table = self.read_bytes(rows, parse_options=parse_options)
1480 assert table.to_pydict() == {
1481 'a': [None, 1, None, 3],
1482 'b': [None, 2, None, 4],
1483 }
1484 read_options = ReadOptions(skip_rows=2)
1485 table = self.read_bytes(rows, parse_options=parse_options,
1486 read_options=read_options)
1487 assert table.to_pydict() == {
1488 '1': [None, 3],
1489 '2': [None, 4],
1490 }
1491
1492 def test_invalid_csv(self):
1493 # Various CSV errors

Callers

nothing calls this directly

Calls 3

read_bytesMethod · 0.95
ParseOptionsClass · 0.90
ReadOptionsClass · 0.90

Tested by

no test coverage detected