Schema.sink_parquet#

classmethod Schema.sink_parquet(
lf: LazyFrame[Self],
/,
file: str | Path | IO[bytes] | PartitioningScheme,
**kwargs: Any,
) None[source]#

Stream a typed lazy frame with this schema to a parquet file.

This method automatically adds a serialization of this schema to the parquet file as metadata. This metadata can be leveraged by read_parquet() and scan_parquet() for more efficient reading, or by external tools.

Parameters:
  • lf – The lazy frame to write to the parquet file.

  • file – The file path, writable file-like object, or partitioning scheme to which to write the parquet file.

  • kwargs – Additional keyword arguments passed directly to polars.write_parquet(). metadata may only be provided if it is a dictionary.

Attention

Be aware that this method suffers from the same limitations as serialize().