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

Method test_one_chunk

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

Source from the content-addressed store, hash-verified

821 assert table.to_pydict() == expected_data
822
823 def test_one_chunk(self):
824 # ARROW-7661: lack of newline at end of file should not produce
825 # an additional chunk.
826 rows = [b"a,b", b"1,2", b"3,4", b"56,78"]
827 for line_ending in [b'\n', b'\r', b'\r\n']:
828 for file_ending in [b'', line_ending]:
829 data = line_ending.join(rows) + file_ending
830 table = self.read_bytes(data)
831 assert len(table.to_batches()) == 1
832 assert table.to_pydict() == {
833 "a": [1, 3, 56],
834 "b": [2, 4, 78],
835 }
836
837 def test_header_column_names(self):
838 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