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