11# (C) 2021 GoodData Corporation
22from __future__ import annotations
33
4- from typing import Callable , Optional , Union
4+ from typing import Callable , Literal , Optional , Union
55
66import pandas
77from gooddata_api_client import models
@@ -259,6 +259,7 @@ def for_created_visualization(
259259 on_execution_submitted : Optional [Callable [[Execution ], None ]] = None ,
260260 is_cancellable : bool = False ,
261261 optimized : bool = False ,
262+ grand_totals_position : Optional [Literal ["pinnedBottom" , "pinnedTop" , "bottom" , "top" ]] = "bottom" ,
262263 ) -> tuple [pandas .DataFrame , DataFrameMetadata ]:
263264 """
264265 Creates a data frame using a created visualization.
@@ -272,6 +273,9 @@ def for_created_visualization(
272273 headers in memory as lists of dicts, which can consume a lot of memory for large results.
273274 Optimized accumulator stores only unique values and story only reference to them in the list,
274275 which can significantly reduce memory usage.
276+ grand_totals_position (Literal["pinnedBottom", "pinnedTop", "bottom", "top"], optional):
277+ Position where grand totals should be placed. "pinnedBottom" and "bottom" append totals,
278+ "pinnedTop" and "top" prepend totals. Defaults to "bottom".
275279
276280 Returns:
277281 pandas.DataFrame: A DataFrame instance.
@@ -283,6 +287,7 @@ def for_created_visualization(
283287 exec_def = execution_definition ,
284288 on_execution_submitted = on_execution_submitted ,
285289 optimized = optimized ,
290+ grand_totals_position = grand_totals_position ,
286291 )
287292
288293 def result_cache_metadata_for_exec_result_id (self , result_id : str ) -> ResultCacheMetadata :
@@ -306,6 +311,7 @@ def for_exec_def(
306311 page_size : int = _DEFAULT_PAGE_SIZE ,
307312 on_execution_submitted : Optional [Callable [[Execution ], None ]] = None ,
308313 optimized : bool = False ,
314+ grand_totals_position : Optional [Literal ["pinnedBottom" , "pinnedTop" , "bottom" , "top" ]] = "bottom" ,
309315 ) -> tuple [pandas .DataFrame , DataFrameMetadata ]:
310316 """
311317 Creates a data frame using an execution definition.
@@ -342,6 +348,9 @@ def for_exec_def(
342348 headers in memory as lists of dicts, which can consume a lot of memory for large results.
343349 Optimized accumulator stores only unique values and story only reference to them in the list,
344350 which can significantly reduce memory usage.
351+ grand_totals_position (Literal["pinnedBottom", "pinnedTop", "bottom", "top"], optional):
352+ Position where grand totals should be placed. "pinnedBottom" and "bottom" append totals,
353+ "pinnedTop" and "top" prepend totals. Defaults to "bottom".
345354
346355 Returns:
347356 Tuple[pandas.DataFrame, DataFrameMetadata]: Tuple holding DataFrame and DataFrame metadata.
@@ -363,6 +372,7 @@ def for_exec_def(
363372 result_size_bytes_limit = result_size_bytes_limit ,
364373 page_size = page_size ,
365374 optimized = optimized ,
375+ grand_totals_position = grand_totals_position ,
366376 )
367377
368378 def for_exec_result_id (
@@ -376,6 +386,7 @@ def for_exec_result_id(
376386 use_primary_labels_in_attributes : bool = False ,
377387 page_size : int = _DEFAULT_PAGE_SIZE ,
378388 optimized : bool = False ,
389+ grand_totals_position : Optional [Literal ["pinnedBottom" , "pinnedTop" , "bottom" , "top" ]] = "bottom" ,
379390 ) -> tuple [pandas .DataFrame , DataFrameMetadata ]:
380391 """
381392 Retrieves a DataFrame and DataFrame metadata for a given execution result identifier.
@@ -410,6 +421,9 @@ def for_exec_result_id(
410421 headers in memory as lists of dicts, which can consume a lot of memory for large results.
411422 Optimized accumulator stores only unique values and story only reference to them in the list,
412423 which can significantly reduce memory usage.
424+ grand_totals_position (Literal["pinnedBottom", "pinnedTop", "bottom", "top"], optional):
425+ Position where grand totals should be placed. "pinnedBottom" and "bottom" append totals,
426+ "pinnedTop" and "top" prepend totals. Defaults to "bottom".
413427
414428 Returns:
415429 Tuple[pandas.DataFrame, DataFrameMetadata]: Tuple holding DataFrame and DataFrame metadata.
@@ -436,4 +450,5 @@ def for_exec_result_id(
436450 use_primary_labels_in_attributes = use_primary_labels_in_attributes ,
437451 page_size = page_size ,
438452 optimized = optimized ,
453+ grand_totals_position = grand_totals_position ,
439454 )
0 commit comments