gooddata_sdk.table.ExecutionTable

class gooddata_sdk.table.ExecutionTable(response: Execution, first_page: ExecutionResult)

Bases: object

Represents execution result as a table. This is a convenience wrapper for executions constructed using the following convention:

  • all attributes are in the first dimension

  • all metrics are in the second dimension

  • if the execution is attribute- or metric-less, then there is always single dimension

The mapping to rows is then as follows:

  • both attributes + metrics are on the execution = iteration over first dimension; as many rows as total records in the first dimension (paging.total[0])

  • just attributes = iteration over just headers in first dimension; as many rows as total records in the first dimension (paging.total[0])

  • just metrics = single row, all metrics values returned in one row

__init__(response: Execution, first_page: ExecutionResult) None

Methods

__init__(response, first_page)

read_all()

Returns a generator that will be yielding execution result as rows.

Attributes

attributes

column_ids

Returns column identifiers.

column_metadata

Returns mapping of column identifier to definition of either attribute whose elements will be in that column or metric whose value will be calculated in that column.

metrics

property column_ids: list[str]

Returns column identifiers. Each row will be a mapping of column identifier to column data.

property column_metadata: dict[str, Union[Attribute, Metric]]

Returns mapping of column identifier to definition of either attribute whose elements will be in that column or metric whose value will be calculated in that column.

read_all() Generator[dict[str, Any], None, None]

Returns a generator that will be yielding execution result as rows. Each row is a dict() mapping column identifier to value of that column.

Returns

generator yielding dict() representing rows of the table