Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/gooddata-sdk/src/gooddata_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
ExportCustomOverride,
ExportRequest,
ExportSettings,
GrandTotalsPosition,
SlidesExportRequest,
VisualExportRequest,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# (C) 2023 GoodData Corporation
from __future__ import annotations

from typing import Literal

from attrs import define
Expand All @@ -12,6 +14,8 @@

from gooddata_sdk.catalog.base import Base

GrandTotalsPosition = Literal["pinnedBottom", "pinnedTop", "bottom", "top"]


@define(kw_only=True)
class ExportCustomLabel(Base):
Expand Down Expand Up @@ -46,6 +50,7 @@ def client_class() -> type[ApiCustomOverride]:
class ExportSettings(Base):
merge_headers: bool
show_filters: bool
grand_totals_position: GrandTotalsPosition | None = None

@staticmethod
def client_class() -> type[ApiSettings]:
Expand Down
17 changes: 17 additions & 0 deletions packages/gooddata-sdk/tests/export/test_export_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@
import os
from pathlib import Path

import pytest

from gooddata_sdk import (
Attribute,
ExecutionDefinition,
ExportCustomLabel,
ExportCustomMetric,
ExportCustomOverride,
ExportRequest,
ExportSettings,
GoodDataSdk,
GrandTotalsPosition,
ObjId,
SimpleMetric,
TableDimension,
Expand Down Expand Up @@ -89,6 +93,19 @@ def _tabular_by_visualization_id_base(test_config, export_format: str):
_validate_clean(goal_path)


@pytest.mark.parametrize(
"grand_totals_position",
[None, "pinnedBottom", "pinnedTop", "bottom", "top"],
)
def test_export_settings_grand_totals_position(grand_totals_position: GrandTotalsPosition | None):
settings = ExportSettings(
merge_headers=True,
show_filters=False,
grand_totals_position=grand_totals_position,
)
assert settings.grand_totals_position == grand_totals_position


@gd_vcr.use_cassette(str(_fixtures_dir / "test_export_csv.yaml"))
def test_export_csv(test_config):
_tabular_export_base(test_config, "CSV")
Expand Down
Loading