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

Method test_empty_lines

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

Source from the content-addressed store, hash-verified

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