-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #845 from gooddata/snapshot-master-be0ea8ae-to-rel…
…/dev [bot] Merge master/be0ea8ae into rel/dev
- Loading branch information
Showing
11 changed files
with
6,174 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...ta-sdk/gooddata_sdk/catalog/workspace/declarative_model/workspace/analytics_model/base.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# (C) 2024 GoodData Corporation | ||
from pathlib import Path | ||
from typing import Any, Optional, TypeVar | ||
|
||
from attrs import define | ||
|
||
from gooddata_sdk.catalog.base import Base | ||
from gooddata_sdk.catalog.identifier import CatalogUserIdentifier | ||
from gooddata_sdk.utils import read_layout_from_file, write_layout_to_file | ||
|
||
T = TypeVar("T", bound="CatalogAnalyticsObjectBase") | ||
|
||
|
||
@define(auto_attribs=True, kw_only=True) | ||
class CatalogAnalyticsObjectBase(Base): | ||
id: str | ||
|
||
def store_to_disk(self, analytics_folder: Path) -> None: | ||
analytics_file = analytics_folder / f"{self.id}.yaml" | ||
write_layout_to_file(analytics_file, self.to_api().to_dict(camel_case=True)) | ||
|
||
@classmethod | ||
def load_from_disk(cls: type[T], analytics_file: Path) -> T: | ||
analytics_layout = read_layout_from_file(analytics_file) | ||
return cls.from_dict(analytics_layout) | ||
|
||
|
||
@define(auto_attribs=True, kw_only=True) | ||
class CatalogAnalyticsBaseMeta(CatalogAnalyticsObjectBase): | ||
created_at: Optional[str] = None | ||
created_by: Optional[CatalogUserIdentifier] = None | ||
modified_at: Optional[str] = None | ||
modified_by: Optional[CatalogUserIdentifier] = None | ||
|
||
|
||
@define(auto_attribs=True, kw_only=True) | ||
class CatalogAnalyticsBase(CatalogAnalyticsBaseMeta): | ||
title: str | ||
content: dict[str, Any] | ||
description: Optional[str] = None | ||
tags: Optional[list[str]] = None |
43 changes: 43 additions & 0 deletions
43
...ta_sdk/catalog/workspace/declarative_model/workspace/analytics_model/export_definition.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# (C) 2024 GoodData Corporation | ||
from typing import Optional | ||
|
||
from attrs import define | ||
from gooddata_api_client.model.declarative_export_definition import DeclarativeExportDefinition | ||
from gooddata_api_client.model.declarative_export_definition_request_payload import ( | ||
DeclarativeExportDefinitionRequestPayload, | ||
) | ||
|
||
from gooddata_sdk import ExportCustomOverride, ExportSettings | ||
from gooddata_sdk.catalog.base import Base | ||
from gooddata_sdk.catalog.workspace.declarative_model.workspace.analytics_model.base import CatalogAnalyticsBaseMeta | ||
|
||
|
||
@define(auto_attribs=True, kw_only=True) | ||
class CatalogDeclarativeExportDefinitionRequestPayload(Base): | ||
custom_override: Optional[ExportCustomOverride] = None | ||
execution_result: Optional[str] = None | ||
metadata: Optional[dict] = None | ||
related_dashboard_id: Optional[str] = None | ||
settings: Optional[ExportSettings] = None | ||
visualization_object: Optional[str] = None | ||
visualization_object_custom_filters: Optional[list[dict]] = None | ||
file_name: Optional[str] = None | ||
format: Optional[str] = None | ||
dashboard_id: Optional[str] = None | ||
|
||
@staticmethod | ||
def client_class() -> type[DeclarativeExportDefinitionRequestPayload]: | ||
return DeclarativeExportDefinitionRequestPayload | ||
|
||
|
||
@define(auto_attribs=True, kw_only=True) | ||
class CatalogDeclarativeExportDefinition(CatalogAnalyticsBaseMeta): | ||
id: str | ||
title: str | ||
request_payload: CatalogDeclarativeExportDefinitionRequestPayload | ||
description: Optional[str] = None | ||
tags: Optional[list[str]] = None | ||
|
||
@staticmethod | ||
def client_class() -> type[DeclarativeExportDefinition]: | ||
return DeclarativeExportDefinition |
Oops, something went wrong.