Skip to main content
Session.create_cube(
    fact_table: Table,
    name: str | None = None,
    *,
    mode: ‘auto’ | ‘manual’ | ‘no_measures’ = 'auto',
    feeding: CubeFeeding = 'enabled',
    filter: CubeFilterCondition | None = None,
    id_in_cluster: str | None = None,
    priority: Annotated[int, Field(gt=0)] | None = None,
) → Cube
Create a cube based on the passed table.

Parameters

fact_table

The table containing the facts of the cube.

name

The name of the created cube. Defaults to the name of fact_table.

mode

The cube creation mode:
  • auto: Creates hierarchies for every key column or non-numeric column of the table, and measures for every numeric column.
  • manual: Does not create any hierarchy or measure (except from the count).
  • no_measures: Creates the hierarchies like auto but does not create any measures.

feeding

Initial value of atoti.Cube.feeding.

filter

If not None, only rows of the database matching this condition will be fed to the cube. It can also reduce costs when using DirectQuery since the filter will be applied to the queries executed on the external database to feed the cube.

id_in_cluster

The human-friendly name used to identify this data cube in a cluster.

priority

The priority of this data cube when using distribution with atoti.QueryCubeDefinition.allow_data_duplication set to True. Data cubes with the lowest value will be queried in priority.
  • If two data cubes have the same priority, one will be chosen at random.
  • If None, duplicated data is retrieved in priority from the data cube with the fewest members in the distributing_levels.