Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRIVIAL: add an 'exclude' argument to store_analytics_model_to_disk #365

Merged
1 commit merged into from
Oct 2, 2023
Merged
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
10 changes: 7 additions & 3 deletions gooddata-sdk/gooddata_sdk/catalog/workspace/content_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand All @@ -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:
Expand Down