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

Method test_one_chunk

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

Source from the content-addressed store, hash-verified

837 assert table.to_pydict() == expected_data
838
839 def test_one_chunk(self):
840 # ARROW-7661: lack of newline at end of file should not produce
841 # an additional chunk.
842 rows = [b"a,b", b"1,2", b"3,4", b"56,78"]
843 for line_ending in [b'\n', b'\r', b'\r\n']:
844 for file_ending in [b'', line_ending]:
845 data = line_ending.join(rows) + file_ending
846 table = self.read_bytes(data)
847 assert len(table.to_batches()) == 1
848 assert table.to_pydict() == {
849 "a": [1, 3, 56],
850 "b": [2, 4, 78],
851 }
852
853 def test_header_column_names(self):
854 rows = b"ab,cd\nef,gh\nij,kl\nmn,op\n"

Callers

nothing calls this directly

Calls 4

read_bytesMethod · 0.95
lenFunction · 0.85
to_batchesMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected