(self)
| 1695 | self.check_reader(reader, expected_schema, []) |
| 1696 | |
| 1697 | def test_inference(self): |
| 1698 | # Inference is done on first block |
| 1699 | rows = b"a,b\n123,456\nabc,de\xff\ngh,ij\n" |
| 1700 | expected_schema = pa.schema([('a', pa.string()), |
| 1701 | ('b', pa.binary())]) |
| 1702 | |
| 1703 | read_options = ReadOptions() |
| 1704 | read_options.block_size = len(rows) |
| 1705 | reader = self.open_bytes(rows, read_options=read_options) |
| 1706 | self.check_reader(reader, expected_schema, |
| 1707 | [{'a': ['123', 'abc', 'gh'], |
| 1708 | 'b': [b'456', b'de\xff', b'ij']}]) |
| 1709 | |
| 1710 | read_options.block_size = len(rows) - 1 |
| 1711 | reader = self.open_bytes(rows, read_options=read_options) |
| 1712 | self.check_reader(reader, expected_schema, |
| 1713 | [{'a': ['123', 'abc'], |
| 1714 | 'b': [b'456', b'de\xff']}, |
| 1715 | {'a': ['gh'], |
| 1716 | 'b': [b'ij']}]) |
| 1717 | |
| 1718 | def test_inference_failure(self): |
| 1719 | # Inference on first block, then conversion failure on second block |
nothing calls this directly
no test coverage detected