(self)
| 1625 | self.check_reader(reader, expected_schema, []) |
| 1626 | |
| 1627 | def test_inference(self): |
| 1628 | # Inference is done on first block |
| 1629 | rows = b"a,b\n123,456\nabc,de\xff\ngh,ij\n" |
| 1630 | expected_schema = pa.schema([('a', pa.string()), |
| 1631 | ('b', pa.binary())]) |
| 1632 | |
| 1633 | read_options = ReadOptions() |
| 1634 | read_options.block_size = len(rows) |
| 1635 | reader = self.open_bytes(rows, read_options=read_options) |
| 1636 | self.check_reader(reader, expected_schema, |
| 1637 | [{'a': ['123', 'abc', 'gh'], |
| 1638 | 'b': [b'456', b'de\xff', b'ij']}]) |
| 1639 | |
| 1640 | read_options.block_size = len(rows) - 1 |
| 1641 | reader = self.open_bytes(rows, read_options=read_options) |
| 1642 | self.check_reader(reader, expected_schema, |
| 1643 | [{'a': ['123', 'abc'], |
| 1644 | 'b': [b'456', b'de\xff']}, |
| 1645 | {'a': ['gh'], |
| 1646 | 'b': [b'ij']}]) |
| 1647 | |
| 1648 | def test_inference_failure(self): |
| 1649 | # Inference on first block, then conversion failure on second block |
nothing calls this directly
no test coverage detected