polars.io.partition.KeyedPartitionContext#

class polars.io.partition.KeyedPartitionContext(
file_idx: int,
part_idx: int,
in_part_idx: int,
keys: list[KeyedPartition],
file_path: Path,
full_path: Path,
)[source]#

Callback context for a partition creation using keys.

Warning

This functionality is currently considered unstable. It may be changed at any point without it being considered a breaking change.

__init__(
file_idx: int,
part_idx: int,
in_part_idx: int,
keys: list[KeyedPartition],
file_path: Path,
full_path: Path,
) None[source]#

Methods

__init__(file_idx, part_idx, in_part_idx, ...)

hive_dirs()

The keys mapped to hive directories.

Attributes

file_idx

The index of the created file starting from zero.

part_idx

The index of the created partition starting from zero.

in_part_idx

The index of the file within this partition starting from zero.

keys

All the key names and values used for this partition.

file_path

The chosen output path before the callback was called without base_path.

full_path

The chosen output path before the callback was called with base_path.