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

Method test_empty_lines

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

Source from the content-addressed store, hash-verified

1398 assert table.to_pydict() == {'': []}
1399
1400 def test_empty_lines(self):
1401 rows = b"a,b\n\r1,2\r\n\r\n3,4\r\n"
1402 table = self.read_bytes(rows)
1403 assert table.to_pydict() == {
1404 'a': [1, 3],
1405 'b': [2, 4],
1406 }
1407 parse_options = ParseOptions(ignore_empty_lines=False)
1408 table = self.read_bytes(rows, parse_options=parse_options)
1409 assert table.to_pydict() == {
1410 'a': [None, 1, None, 3],
1411 'b': [None, 2, None, 4],
1412 }
1413 read_options = ReadOptions(skip_rows=2)
1414 table = self.read_bytes(rows, parse_options=parse_options,
1415 read_options=read_options)
1416 assert table.to_pydict() == {
1417 '1': [None, 3],
1418 '2': [None, 4],
1419 }
1420
1421 def test_invalid_csv(self):
1422 # 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