mecfs_bio.build_system.task.dataframe_output
How a task writes a dataframe asset: the output format types, and the single writer that interprets them.
Classes:
-
CSVOutFormat– -
ParquetOutFormat– -
ParquetWriteOptions–How to encode a parquet output, when the defaults are not good enough.
Functions:
-
float_column_names–Names of the floating-point columns, the ones worth byte-stream-splitting.
-
get_extension_and_read_spec_from_format– -
write_df_according_to_format–Write a dataframe to out_path in the requested format.
-
write_parquet_table–Write an arrow table to parquet with explicit encoding control.
Attributes:
ParquetCompression
module-attribute
ParquetOutFormat
Attributes:
-
write_options(ParquetWriteOptions | None) –
ParquetWriteOptions
How to encode a parquet output, when the defaults are not good enough.
Attributes:
-
byte_stream_split_floats(bool) – -
compression(ParquetCompression) – -
compression_level(int | None) –
float_column_names
Names of the floating-point columns, the ones worth byte-stream-splitting.
Source code in mecfs_bio/build_system/task/dataframe_output.py
get_extension_and_read_spec_from_format
Source code in mecfs_bio/build_system/task/dataframe_output.py
write_df_according_to_format
Write a dataframe to out_path in the requested format. The frame's backend is preserved: narwhals dispatches to the underlying library's own writer
Source code in mecfs_bio/build_system/task/dataframe_output.py
write_parquet_table
write_parquet_table(
table: Table,
out_path: Path,
compression: ParquetCompression,
compression_level: int | None,
byte_stream_split_columns: Sequence[str],
) -> None
Write an arrow table to parquet with explicit encoding control.
Dictionary encoding takes precedence over BYTE_STREAM_SPLIT in the parquet writer: a column left dictionary-enabled is written as RLE_DICTIONARY and the requested split is silently dropped, producing a file byte-identical to one written without it. Dictionary encoding is therefore disabled on exactly the split columns and left on for the rest, where it is what makes low-cardinality string columns small.
Pass an empty byte_stream_split_columns to disable the split entirely.