From 37526434381c4fe54bc94e0d34da3458cdd6b62c Mon Sep 17 00:00:00 2001 From: hkad98 Date: Mon, 2 Oct 2023 14:27:28 +0200 Subject: [PATCH] Add an 'exclude' argument to store_analytics_model_to_disk --- .../gooddata_sdk/catalog/workspace/content_service.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gooddata-sdk/gooddata_sdk/catalog/workspace/content_service.py b/gooddata-sdk/gooddata_sdk/catalog/workspace/content_service.py index 8ed480d9b..833fb64fb 100644 --- a/gooddata-sdk/gooddata_sdk/catalog/workspace/content_service.py +++ b/gooddata-sdk/gooddata_sdk/catalog/workspace/content_service.py @@ -361,7 +361,7 @@ def get_declarative_analytics_model( workspace_id (str): Workspace identification string e.g. "demo" exclude (Optional[List[str]]): - Defines properties which should not be included in the payload. + Defines properties which should not be included in the payload. E.g.: ["ACTIVITY_INFO"] Returns: CatalogDeclarativeAnalytics: @@ -439,7 +439,9 @@ def load_and_put_declarative_analytics_model(self, workspace_id: str, layout_roo declarative_analytics_model = self.load_declarative_analytics_model(workspace_id, layout_root_path) self.put_declarative_analytics_model(workspace_id, declarative_analytics_model) - def store_analytics_model_to_disk(self, workspace_id: str, path: Path = Path.cwd()) -> None: + def store_analytics_model_to_disk( + self, workspace_id: str, path: Path = Path.cwd(), exclude: Optional[List[str]] = None + ) -> None: """Store analytics model for a given workspace in directory hierarchy.This method does not tie the declarative analytics model to the workspace and organization, thus it is recommended for migration between workspaces. If you want to migrate analytics model between workspaces, use store_analytics_model_to_disk. @@ -449,11 +451,13 @@ def store_analytics_model_to_disk(self, workspace_id: str, path: Path = Path.cwd Workspace identification string e.g. "demo" path (Path, optional): Path to the root of the layout directory. Defaults to Path.cwd(). + exclude (Optional[List[str]]): + Defines properties which should not be included in the payload. E.g.: ["ACTIVITY_INFO"] Returns: None """ - self.get_declarative_analytics_model(workspace_id).store_to_disk(path) + self.get_declarative_analytics_model(workspace_id, exclude).store_to_disk(path) @staticmethod def load_analytics_model_from_disk(path: Path = Path.cwd()) -> CatalogDeclarativeAnalytics: