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

Method test_options_delimiter

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

Source from the content-addressed store, hash-verified

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