This documentation is for the unstable version of GoodData, currrently in development.
For stable version, go to the latest stable version of this article.
For stable version, go to the latest stable version of this article.
DataFrameFactory.
for_arrow_table
for_arrow_table(table: pa.Table, execution_response: BareExecutionResponse | None, label_overrides: Optional[LabelOverrides], grand_totals_position: Literal['pinnedBottom', 'pinnedTop', 'bottom', 'top']) -> tuple[pandas.DataFrame, DataFrameMetadata]
Creates a DataFrame from an already-obtained PyArrow Table.
Use this when you have fetched Arrow IPC bytes yourself (e.g. from the raw export REST API or a future Flight RPC endpoint) and converted them to a ``pa.Table``. For the common case of submitting an execution and reading the result in one call, use :meth:for_exec_def_arrow instead.
Technical Arrow parameters (self_destruct, types_mapper, custom_mapping) are configured on the factory via ArrowConfig.
Parameters
| name | type | description |
|---|---|---|
| table | pa.Table | PyArrow Table as returned by the GoodData binary execution endpoint. |
| execution_response | BareExecutionResponse | None | Optional ``BareExecutionResponse`` from the execution that produced this table. When provided, ``DataFrameMetadata.row_totals_indexes`` and ``DataFrameMetadata.column_totals_indexes`` are computed accurately and ``DataFrameMetadata.execution_response`` is populated. When omitted, both totals indexes are empty lists and ``execution_response`` is ``None``. |
| label_overrides | Optional[LabelOverrides] | Label overrides for metrics and attributes. |
| grand_totals_position | Literal['pinnedBottom', 'pinnedTop', 'bottom', 'top'] | Position where grand total rows should be placed. ``"pinnedBottom"`` and ``"bottom"`` keep totals at the end (default). ``"pinnedTop"`` and ``"top"`` move grand total rows to the beginning of the DataFrame. Subtotal rows are not repositioned. Defaults to ``"bottom"``. |
Returns
| type | description |
|---|---|
| tuple[pandas.DataFrame, DataFrameMetadata] | Tuple[pandas.DataFrame, DataFrameMetadata] |