-
Notifications
You must be signed in to change notification settings - Fork 60
feat(gooddata-pipelines): Backup workspaces from list of workspace IDs #1110
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
Merged
Conversation
This file contains hidden or 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
4ace2db to
2a88c19
Compare
hkad98
reviewed
Aug 13, 2025
Comment on lines
169
to
172
| if path_to_csv is None and workspace_ids is None: | ||
| raise ValueError( | ||
| f"Path to CSV is required for this input type: {input_type.value}" | ||
| f"Path to CSV or list of workspace IDs is required for this input type: {input_type.value}" | ||
| ) | ||
| elif path_to_csv is not None and workspace_ids is not None: | ||
| raise ValueError( | ||
| f"Path to CSV and list of workspace IDs are mutually exclusive for this input type: {input_type.value}" | ||
| ) |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition can be simplified.
# Both or none of them is specified.
if (path_to_csv is None) == (workspace_ids is None):
hkad98
reviewed
Aug 13, 2025
Comment on lines
179
to
188
| if input_type == InputType.LIST_OF_WORKSPACES: | ||
| return self.csv_reader.read_backup_csv(path_to_csv) | ||
| if path_to_csv is not None: | ||
| return self.csv_reader.read_backup_csv(path_to_csv) | ||
| elif workspace_ids is not None: | ||
| return workspace_ids | ||
| else: | ||
| raise ValueError( | ||
| f"Path to CSV or list of workspace IDs is required for this input type: {input_type.value}" | ||
| ) | ||
| else: | ||
| # For hierarchy backup, we read the CSV and treat it as a list of | ||
| # parent workspace IDs. Then we retrieve the children of each parent, | ||
| # including their children, and so on. The parent workspaces are | ||
| # also included in the backup. | ||
| list_of_parents = self.csv_reader.read_backup_csv(path_to_csv) | ||
| if path_to_csv is not None: | ||
| list_of_parents = self.csv_reader.read_backup_csv( | ||
| path_to_csv | ||
| ) | ||
| elif workspace_ids is not None: | ||
| list_of_parents = workspace_ids | ||
| else: | ||
| raise ValueError( | ||
| f"Path to CSV or list of workspace IDs is required for this input type: {input_type.value}" | ||
| ) | ||
| list_of_children: list[str] = [] |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposed simplification:
list_of_parents = self.csv_reader.read_backup_csv(path_to_csv) if path_to_csv is not None else workspace_ids
if input_type == InputType.LIST_OF_WORKSPACES:
return list_of_parents
# This is HIERARCHY, continue with the existing impl5dc4885 to
037ba44
Compare
037ba44 to
31aeaf1
Compare
hkad98
approved these changes
Aug 14, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.