Skip to content

DataFusion

rerun.utilities.datafusion

DataFusion utilities.

collect_to_string_list

def collect_to_string_list(
    df: DataFrame,
    col: str | Expr,
    remove_nulls: bool = True,
) -> list[str | None]

Collect a single column of a DataFrame into a Python string list.

This is a convenience function. DataFusion collection returns a stream of record batches. Sometimes it is preferable to extract a single column out of all of these batches and convert it to a string.

PARAMETER DESCRIPTION
df

The input DataFusion DataFrame

TYPE: DataFrame

col

The column to collect. You can provide either a string column name or a DataFusion expression.

TYPE: str | Expr

remove_nulls

If true, any null values will be removed from the result. If false these will be converted into None.

TYPE: bool DEFAULT: True

segment_url

def segment_url(
    dataset: DatasetEntry,
    *,
    segment_id: str | Expr | None = None,
    timestamp: str | Expr | None = None,
    timeline_name: str | None = None,
    time_range_start: str | Expr | None = None,
    time_range_end: str | Expr | None = None,
    selection: str | Expr | None = None,
) -> Expr

Compute the URL for a segment within a dataset.

This is a Rerun focused DataFusion function that will create a DataFusion expression for the segment URL.

PARAMETER DESCRIPTION
dataset

The input Rerun Dataset.

TYPE: DatasetEntry

segment_id

Expression or column name for the segment ID. If not provided, the column named rerun_segment_id will be used.

TYPE: str | Expr | None DEFAULT: None

timestamp

Expression or column name for a timestamp. Generate a URL that specifies the position of the time cursor when opened by the viewer.

TYPE: str | Expr | None DEFAULT: None

timeline_name

Specifies which timeline to use when used in combination with timestamp and/or time_range_start/ time_range_end. By default, this will use the same string as timestamp if provided.

TYPE: str | None DEFAULT: None

time_range_start

Expression or column name for the start of a time range selection. Must be used together with time_range_end. Generates a URL that specifies a time range to be selected when opened by the viewer.

TYPE: str | Expr | None DEFAULT: None

time_range_end

Expression or column name for the end of a time range selection. Must be used together with time_range_start. Generates a URL that specifies a time range to be selected when opened by the viewer.

TYPE: str | Expr | None DEFAULT: None

selection

Expression or column name for the data path to select. The syntax is an entity path, optionally followed by an instance index and/or component name (e.g. /world/points, /world/points[#42], /world/points:Color, /world/points[#42]:Color). Generates a URL that specifies the data to be selected when opened by the viewer.

TYPE: str | Expr | None DEFAULT: None