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

Method test_options_delimiter

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

Source from the content-addressed store, hash-verified

1688 reader.read_next_batch()
1689
1690 def test_options_delimiter(self):
1691 rows = b"a;b,c\nde,fg;eh\n"
1692 reader = self.open_bytes(rows)
1693 expected_schema = pa.schema([('a;b', pa.string()),
1694 ('c', pa.string())])
1695 self.check_reader(reader, expected_schema,
1696 [{'a;b': ['de'],
1697 'c': ['fg;eh']}])
1698
1699 opts = ParseOptions(delimiter=';')
1700 reader = self.open_bytes(rows, parse_options=opts)
1701 expected_schema = pa.schema([('a', pa.string()),
1702 ('b,c', pa.string())])
1703 self.check_reader(reader, expected_schema,
1704 [{'a': ['de,fg'],
1705 'b,c': ['eh']}])
1706
1707 def test_no_ending_newline(self):
1708 # 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