()
| 204 | |
| 205 | |
| 206 | def test_write_file(): |
| 207 | with tempfile.TemporaryDirectory() as tmp_dir: |
| 208 | fields = {"col_1": pa.string(), "col_2": pa.int64()} |
| 209 | output = os.path.join(tmp_dir, "test.arrow") |
| 210 | with ArrowWriter(path=output, schema=pa.schema(fields)) as writer: |
| 211 | writer.write_batch({"col_1": ["foo", "bar"], "col_2": [1, 2]}) |
| 212 | num_examples, num_bytes = writer.finalize() |
| 213 | assert num_examples == 2 |
| 214 | assert num_bytes > 0 |
| 215 | assert writer._schema == pa.schema(fields, metadata=writer._schema.metadata) |
| 216 | _check_output(output, 1) |
| 217 | |
| 218 | |
| 219 | def get_base_dtype(arr_type): |
nothing calls this directly
no test coverage detected