phenotypic.sdk_.atomic_write_bytes#
- phenotypic.sdk_.atomic_write_bytes(path: str | Path, data: bytes, *, pre_replace: Callable[[], None] | None = None) None[source]#
Atomically write
datatopath(temp sibling +os.replace).The bytes counterpart of
atomic_write_text()for binary payloads (e.g. a serialized parquet buffer). Same crash-safety guarantees: an all-or-nothing replace and no partial/leftover temp file on failure.- Parameters:
- Raises:
OSError – If the write or rename fails (the temp file is removed first).
- Return type:
None