DataFrameFactory.

for_exec_def

for_exec_def(exec_def: ExecutionDefinition, label_overrides: Optional[LabelOverrides], result_size_dimensions_limits: ResultSizeDimensions, result_size_bytes_limit: Optional[int], page_size: int, on_execution_submitted: Optional[Callable[[Execution], None]], optimized: bool, default=False) -> tuple[pandas.DataFrame, DataFrameMetadata]

Creates a data frame using an execution definition.

Each dimension may be sliced by multiple labels. The factory will create MultiIndex for the dataframe's row index and the columns. Example of label_overrides structure: .. code-block:: python { "labels": { "local_attribute_id": { "title": "My new attribute label" ,... }, "metrics": { "local_metric_id": { "title": "My new metric label" },... } }

Parameters

nametypedescription
exec_defExecutionDefinitionExecution definition.
label_overridesOptional[LabelOverrides]Label overrides for metrics and attributes.
result_size_dimensions_limitsResultSizeDimensionsA tuple containing maximum size of result dimensions.
result_size_bytes_limitOptional[int]Maximum size of result in bytes.
page_sizeintNumber of records per page.
on_execution_submittedOptional[Callable[[Execution], None]]Callback to call when the execution was submitted to the backend.
optimizedbool, default=FalseUse memory optimized accumulator if True; by default, the accumulator stores headers in memory as lists of dicts, which can consume a lot of memory for large results. Optimized accumulator stores only unique values and story only reference to them in the list, which can significantly reduce memory usage.

Returns

typedescription
Tuple[pandas.DataFrame, DataFrameMetadata]Tuple holding DataFrame and DataFrame metadata.