Skip to content

Commit de7aca0

Browse files
Auto Implclaude
andcommitted
feat(gooddata-sdk): [AUTO] add grand_totals_position to ExportSettings
Added GrandTotalsPosition TypeAlias and grand_totals_position field to ExportSettings to expose the new grandTotalsPosition API field introduced in TabularExportRequest.Settings for controlling PDF grand total placement. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b95ca11 commit de7aca0

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

packages/gooddata-sdk/src/gooddata_sdk/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
ExportCustomOverride,
7777
ExportRequest,
7878
ExportSettings,
79+
GrandTotalsPosition,
7980
SlidesExportRequest,
8081
VisualExportRequest,
8182
)

packages/gooddata-sdk/src/gooddata_sdk/catalog/export/request.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# (C) 2023 GoodData Corporation
2+
from __future__ import annotations
3+
24
from typing import Literal
35

46
from attrs import define
@@ -12,6 +14,8 @@
1214

1315
from gooddata_sdk.catalog.base import Base
1416

17+
GrandTotalsPosition = Literal["pinnedBottom", "pinnedTop", "bottom", "top"]
18+
1519

1620
@define(kw_only=True)
1721
class ExportCustomLabel(Base):
@@ -46,6 +50,7 @@ def client_class() -> type[ApiCustomOverride]:
4650
class ExportSettings(Base):
4751
merge_headers: bool
4852
show_filters: bool
53+
grand_totals_position: GrandTotalsPosition | None = None
4954

5055
@staticmethod
5156
def client_class() -> type[ApiSettings]:

packages/gooddata-sdk/tests/export/test_export_service.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@
66
import os
77
from pathlib import Path
88

9+
import pytest
10+
911
from gooddata_sdk import (
1012
Attribute,
1113
ExecutionDefinition,
1214
ExportCustomLabel,
1315
ExportCustomMetric,
1416
ExportCustomOverride,
1517
ExportRequest,
18+
ExportSettings,
1619
GoodDataSdk,
20+
GrandTotalsPosition,
1721
ObjId,
1822
SimpleMetric,
1923
TableDimension,
@@ -89,6 +93,19 @@ def _tabular_by_visualization_id_base(test_config, export_format: str):
8993
_validate_clean(goal_path)
9094

9195

96+
@pytest.mark.parametrize(
97+
"grand_totals_position",
98+
[None, "pinnedBottom", "pinnedTop", "bottom", "top"],
99+
)
100+
def test_export_settings_grand_totals_position(grand_totals_position: GrandTotalsPosition | None):
101+
settings = ExportSettings(
102+
merge_headers=True,
103+
show_filters=False,
104+
grand_totals_position=grand_totals_position,
105+
)
106+
assert settings.grand_totals_position == grand_totals_position
107+
108+
92109
@gd_vcr.use_cassette(str(_fixtures_dir / "test_export_csv.yaml"))
93110
def test_export_csv(test_config):
94111
_tabular_export_base(test_config, "CSV")

0 commit comments

Comments
 (0)