Skip to content

Utilities

rerun.utilities

datafusion

DataFusion utilities.

collect
def collect_to_string_list(df, col, remove_nulls=True)

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

functions
url_generation
def segment_url(dataset, *, segment_id=None, timestamp=None, timeline_name=None, time_range_start=None, time_range_end=None, selection=None)

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