Skip to content

Commit

Permalink
Merge pull request #365 from hkad98/metadata-switch
Browse files Browse the repository at this point in the history
TRIVIAL: add an 'exclude' argument to store_analytics_model_to_disk

Reviewed-by: Jan Soubusta
             https://github.com/jaceksan
  • Loading branch information
gdgate authored Oct 2, 2023
2 parents 9055624 + 3752643 commit abe85dc
Showing 1 changed file with 7 additions and 3 deletions.
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

0 comments on commit abe85dc

Please sign in to comment.