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, grand_totals_position: Literal['pinnedBottom', 'pinnedTop', 'bottom', 'top']) -> 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.

When the factory’s use_arrow is True the result is fetched via the Arrow IPC binary endpoint in one shot. In this mode result_size_dimensions_limits, result_size_bytes_limit, page_size, and optimized are ignored.

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"
        },...
    }
}</p>

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. Ignored when use_arrow=True.
result_size_bytes_limitOptional[int]Maximum size of result in bytes. Ignored when use_arrow=True.
page_sizeintNumber of records per page. Ignored when use_arrow=True.
on_execution_submittedOptional[Callable[[Execution], None]]Callback to call when the execution was submitted to the backend.
optimizedbool, default=FalseUse memory optimized accumulator. Ignored when use_arrow=True.
grand_totals_positionLiteral['pinnedBottom', 'pinnedTop', 'bottom', 'top']Position where grand totals should be placed. "pinnedBottom" and "bottom" append totals, "pinnedTop" and "top" prepend totals. Defaults to "bottom".

Returns

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