tlc.core.objects.tables.from_table.unrolled_table#

A table where each row in a sub-column in the input table is unrolled into multiple rows.

Module Contents#

Classes#

Class

Description

UnrolledTable

Creates a derived table by expanding rows based on a list-like sub-column in the input table.

API#

class tlc.core.objects.tables.from_table.unrolled_table.UnrolledTable(url: tlc.core.url.Url | None = None, created: str | None = None, description: str | None = None, row_cache_url: tlc.core.url.Url | None = None, row_cache_populated: bool | None = None, override_table_rows_schema: Any | None = None, input_table_url: tlc.core.url.Url | tlc.core.objects.table.Table | None = None, unroll_property: str | None = None, init_parameters: Any = None)#

Bases: tlc.core.objects.tables.in_memory_rows_table._InMemoryRowsTable

Creates a derived table by expanding rows based on a list-like sub-column in the input table.

The unroll_property should specify a nested path to a list-like value in the input table’s schema. Each row in the derived table is generated by replacing this list-like sub-value with individual items from the list. All other columns will be copied from the input table.

Parameters:
  • input_table_url – The table to unroll.

  • unroll_property – The . separated path to the list-like sub-value to unroll.

Parameters:
  • url – The URL of the table.

  • created – The creation time of the table.

  • description – The description of the table.

  • row_cache_url – The URL of the row cache.

  • row_cache_populated – Whether the row cache is populated.

  • override_table_rows_schema – The schema to override the table rows schema.

  • init_parameters – The initial parameters of the table.

static get_nested_value(row_data: tlc.core.objects.table.TableRow, unroll_property: str) Any#
static set_nested_value(row_data: dict[str, object], path: str, value: Any) None#