task_script_utils.parquet module#
- pandas_dataframe_to_parquet(df: PandasLikeDataFrame, context: Any, file_name: str, *, engine: Literal['pyarrow', 'fastparquet'] = 'pyarrow', compression: str = 'snappy') str[source]#
Converts a Pandas-like DataFrame to Parquet format and writes the result to storage.
- Parameters:
df – A Pandas DataFrame instance.
context (Any) – The task context with a write_file method.
file_name (str) – The target file name for storage.
engine (str) – Parquet engine (“pyarrow” or “fastparquet”).
compression (str) – Compression method (“snappy”, “gzip”, “zstd”, etc).
- Returns:
The file ID assigned by the storage system.
- Return type:
str
- polars_dataframe_to_parquet(df: PolarsLikeDataFrame, context: Any, file_name: str, *, compression: Literal['lz4', 'uncompressed', 'snappy', 'gzip', 'lzo', 'brotli', 'zstd'] = 'snappy') str[source]#
Converts a Polars-like DataFrame to Parquet format and writes the result to storage.
- Parameters:
df – A Polars DataFrame instance.
context (Any) – The task context with a write_file method.
file_name (str) – The target file name for storage.
compression (str) – Compression method (“snappy”, “gzip”, “zstd”, etc).
- Returns:
The file ID assigned by the storage system.
- Return type:
str