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

Method test_one_chunk

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

Source from the content-addressed store, hash-verified

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