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

Method test_options_delimiter

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

Source from the content-addressed store, hash-verified

1758 reader.read_next_batch()
1759
1760 def test_options_delimiter(self):
1761 rows = b"a;b,c\nde,fg;eh\n"
1762 reader = self.open_bytes(rows)
1763 expected_schema = pa.schema([('a;b', pa.string()),
1764 ('c', pa.string())])
1765 self.check_reader(reader, expected_schema,
1766 [{'a;b': ['de'],
1767 'c': ['fg;eh']}])
1768
1769 opts = ParseOptions(delimiter=';')
1770 reader = self.open_bytes(rows, parse_options=opts)
1771 expected_schema = pa.schema([('a', pa.string()),
1772 ('b,c', pa.string())])
1773 self.check_reader(reader, expected_schema,
1774 [{'a': ['de,fg'],
1775 'b,c': ['eh']}])
1776
1777 def test_no_ending_newline(self):
1778 # No \n after last line

Callers

nothing calls this directly

Calls 5

open_bytesMethod · 0.95
check_readerMethod · 0.95
ParseOptionsClass · 0.90
schemaMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected