import dascore as dc
import tempfile
from pathlib import Path
patch = dc.get_example_patch()
path = Path(tempfile.mkdtemp()) / "patch.arrow"
_ = dc.write(patch, path, "ARROW")
assert dc.spool(path)[0] == patchArrowV1
ArrowV1()
The DASCore Arrow patch format: one patch per Arrow IPC file or stream.
The patch’s values are one Arrow column, data, flattened in C order and split into record batches; the dims, shape, coordinates and attrs are a JSON document in the schema metadata. Other Arrow tools read the values as an ordinary column. Coordinates and attrs read back exactly, including the patch’s ids. Complex data and object attrs can’t be stored. Needs pyarrow.
Examples
Methods
| Name | Description |
|---|---|
| get_format | Derive the format name and version from the family detector. |
| get_metadata | Describe the patch from its schema metadata, reading no data. |
| get_version | Return the version if the resource is an Arrow patch. |
| read | Read patches by selecting metadata and loading the resulting array windows. |
| read_array | Read and check the patch’s values, then take the requested window. |
| scan | Return patch metadata; the dispatcher attaches source provenance. |
| unit_members | Return the files identifying a directory unit of this format, if any. |
| write | Write one patch. |