pyarrow.ipc.new_file#

pyarrow.ipc.new_file(sink,schema,*,options=None,metadata=None)[source]#

Create an Arrow columnar IPC file writer instance

Parameters:
sinkstr,pyarrow.NativeFile, or file-like Python object

Either a file path, or a writable file object.

schemapyarrow.Schema

The Arrow schema for data to be written to the file.

optionspyarrow.ipc.IpcWriteOptions

Options for IPC serialization.

If None, default values will be used: the legacy format will notbe used unless overridden by setting the environment variableARROW_PRE_0_15_IPC_FORMAT=1, and the V5 metadata version will beused unless overridden by setting the environment variableARROW_PRE_1_0_METADATA_VERSION=1.

metadatadict |pyarrow.KeyValueMetadata, optional

Key/value pairs (both must be bytes-like) that will be storedin the file footer and are retrievable viapyarrow.ipc.open_file(…).metadata.

Returns:
writerRecordBatchFileWriter

A writer for the given sink