from_partitioned_table
The from_partitioned_table method creates a new PartitionedTable from an underlying partitioned table with specifications such as which key columns to include, whether to allow changes to constituent tables, and more. It is a class method, meaning it can be called on both an instance of a class, or the class itself.
Warning
The key_cols, unique_keys, constituent_column, constituent_table_columns, and constituent_changes_permitted parameters either must all be None, or must all have values.
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
| table | Table | The underlying |
| key_cols optional | Union[str, List[str]] | The key column(s) of If |
| unique_keys optional | bool | Whether the keys in If |
| constituent_column optional | str | The constituent column name in If |
| constituent_table_columns optional | List[Column] | The column definitions of the constituent table. If |
| constituent_changes_permitted optional | bool | Whether the constituent tables can be changed. If |
Returns
A PartitionedTable.
Example
The following example uses from_partitioned_table to construct a partitioned table from an underlying partitioned table (agg_table). It calls the method on the PartitionedTable class itself, and sets each of the optional input parameters.