gooddata-pipelines 1.48.1.dev2__py3-none-any.whl → 1.48.1.dev4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of gooddata-pipelines might be problematic. Click here for more details.

@@ -158,25 +158,33 @@ class BackupInputProcessor:
158
158
  return all_workspaces
159
159
 
160
160
  def get_ids_to_backup(
161
- self, input_type: InputType, path_to_csv: str | None = None
161
+ self,
162
+ input_type: InputType,
163
+ path_to_csv: str | None = None,
164
+ workspace_ids: list[str] | None = None,
162
165
  ) -> list[str]:
163
166
  """Returns the list of workspace IDs to back up based on the input type."""
164
167
 
165
168
  if input_type in (InputType.LIST_OF_WORKSPACES, InputType.HIERARCHY):
166
- if path_to_csv is None:
169
+ if (path_to_csv is None) == (workspace_ids is None):
167
170
  raise ValueError(
168
- f"Path to CSV is required for this input type: {input_type.value}"
171
+ f"Path to CSV and list of workspace IDs must be specified exclusively for this input type: {input_type.value}"
169
172
  )
170
173
 
171
174
  # If we're backing up based on the list, simply read it from the CSV
175
+ list_of_parents = []
176
+ if path_to_csv is not None:
177
+ list_of_parents = self.csv_reader.read_backup_csv(path_to_csv)
178
+ if workspace_ids is not None:
179
+ list_of_parents = workspace_ids
180
+
172
181
  if input_type == InputType.LIST_OF_WORKSPACES:
173
- return self.csv_reader.read_backup_csv(path_to_csv)
182
+ return list_of_parents
174
183
  else:
175
184
  # For hierarchy backup, we read the CSV and treat it as a list of
176
185
  # parent workspace IDs. Then we retrieve the children of each parent,
177
186
  # including their children, and so on. The parent workspaces are
178
187
  # also included in the backup.
179
- list_of_parents = self.csv_reader.read_backup_csv(path_to_csv)
180
188
  list_of_children: list[str] = []
181
189
 
182
190
  for parent in list_of_parents:
@@ -373,29 +373,37 @@ class BackupManager:
373
373
 
374
374
  raise
375
375
 
376
- def backup_workspaces(self, path_to_csv: str) -> None:
376
+ def backup_workspaces(
377
+ self, path_to_csv: str | None, workspace_ids: list[str] | None
378
+ ) -> None:
377
379
  """Runs the backup process for a list of workspace IDs.
378
380
 
379
- Will read the list of workspace IDs from a CSV file and create backup for
380
- each workspace in storage specified in the configuration.
381
+ Will take the list of workspace IDs or read the list of
382
+ workspace IDs from a CSV file and create backup for each
383
+ workspace in storage specified in the configuration.
381
384
 
382
385
  Args:
383
386
  path_to_csv (str): Path to a CSV file containing a list of workspace IDs.
387
+ workspace_ids (list[str]): List of workspace IDs
384
388
  """
385
- self.backup(InputType.LIST_OF_WORKSPACES, path_to_csv)
389
+ self.backup(InputType.LIST_OF_WORKSPACES, path_to_csv, workspace_ids)
386
390
 
387
- def backup_hierarchies(self, path_to_csv: str) -> None:
391
+ def backup_hierarchies(
392
+ self, path_to_csv: str | None, workspace_ids: list[str] | None
393
+ ) -> None:
388
394
  """Runs the backup process for a list of hierarchies.
389
395
 
390
- Will read the list of workspace IDs from a CSV file and create backup for
391
- each those workspaces' hierarchies in storage specified in the configuration.
396
+ Will take the list of workspace IDs or read the list of workspace IDs
397
+ from a CSV file and create backup for each those workspaces' hierarchies
398
+ in storage specified in the configuration.
392
399
  Workspace hierarchy means the workspace itself and all its direct and
393
400
  indirect children.
394
401
 
395
402
  Args:
396
403
  path_to_csv (str): Path to a CSV file containing a list of workspace IDs.
404
+ workspace_ids (list[str]): List of workspace IDs
397
405
  """
398
- self.backup(InputType.HIERARCHY, path_to_csv)
406
+ self.backup(InputType.HIERARCHY, path_to_csv, workspace_ids)
399
407
 
400
408
  def backup_entire_organization(self) -> None:
401
409
  """Runs the backup process for the entire organization.
@@ -406,12 +414,17 @@ class BackupManager:
406
414
  self.backup(InputType.ORGANIZATION)
407
415
 
408
416
  def backup(
409
- self, input_type: InputType, path_to_csv: str | None = None
417
+ self,
418
+ input_type: InputType,
419
+ path_to_csv: str | None = None,
420
+ workspace_ids: list[str] | None = None,
410
421
  ) -> None:
411
422
  """Runs the backup process with selected input type."""
412
423
  try:
413
424
  workspaces_to_export: list[str] = self.loader.get_ids_to_backup(
414
- input_type, path_to_csv
425
+ input_type,
426
+ path_to_csv,
427
+ workspace_ids,
415
428
  )
416
429
  batches = self.split_to_batches(
417
430
  workspaces_to_export, self.config.batch_size
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gooddata-pipelines
3
- Version: 1.48.1.dev2
3
+ Version: 1.48.1.dev4
4
4
  Author-email: GoodData <support@gooddata.com>
5
5
  License: MIT
6
6
  License-File: LICENSE.txt
7
7
  Requires-Python: >=3.10
8
8
  Requires-Dist: boto3-stubs<2.0.0,>=1.39.3
9
9
  Requires-Dist: boto3<2.0.0,>=1.39.3
10
- Requires-Dist: gooddata-sdk~=1.48.1.dev2
10
+ Requires-Dist: gooddata-sdk~=1.48.1.dev4
11
11
  Requires-Dist: pydantic<3.0.0,>=2.11.3
12
12
  Requires-Dist: requests<3.0.0,>=2.32.3
13
13
  Requires-Dist: types-pyyaml<7.0.0,>=6.0.12.20250326
@@ -8,8 +8,8 @@ gooddata_pipelines/api/gooddata_api_wrapper.py,sha256=t7dFrXJ6X4yXS9XDthOmvd2Cyz
8
8
  gooddata_pipelines/api/gooddata_sdk.py,sha256=wd5O4e9BQLWUawt6odrs5a51nqFGthBkvqh9WOiW36Q,13734
9
9
  gooddata_pipelines/api/utils.py,sha256=3QY_aYH17I9THoCINE3l-n5oj52k-gNeT1wv6Z_VxN8,1433
10
10
  gooddata_pipelines/backup_and_restore/__init__.py,sha256=-BG28PGDbalLyZGQjpFG0pjdIvtf25ut0r8ZwZVbi4s,32
11
- gooddata_pipelines/backup_and_restore/backup_input_processor.py,sha256=1-Sh0n4DrBrQ7M3Hzq_iiNe-2cxQx0KDu4QdDok618I,7667
12
- gooddata_pipelines/backup_and_restore/backup_manager.py,sha256=NS3dKc6C7VVfuFQxG0opQitcc23GwCntbLirAhWQei0,15441
11
+ gooddata_pipelines/backup_and_restore/backup_input_processor.py,sha256=ex1tGwETdHDDBRJ_DGKZsZbH6uoRuOrbGbKOC976H5s,7940
12
+ gooddata_pipelines/backup_and_restore/backup_manager.py,sha256=MZJIdaWp3KlhUFv0V0lh495X-LHGUsNSEsrxKfvuHgE,15898
13
13
  gooddata_pipelines/backup_and_restore/constants.py,sha256=AO4H6ngsLMs4bCV-RcT7xIi-VZu3smgZWA_3P7lVsQc,907
14
14
  gooddata_pipelines/backup_and_restore/csv_reader.py,sha256=0Kw7mJT7REj3Gjqfsc6YT9MbhcqfCGNB_SKBwzTI1rk,1268
15
15
  gooddata_pipelines/backup_and_restore/models/__init__.py,sha256=-BG28PGDbalLyZGQjpFG0pjdIvtf25ut0r8ZwZVbi4s,32
@@ -48,7 +48,7 @@ gooddata_pipelines/provisioning/utils/__init__.py,sha256=-BG28PGDbalLyZGQjpFG0pj
48
48
  gooddata_pipelines/provisioning/utils/context_objects.py,sha256=sM22hMsxE0XLI1TU0Vs-2kK0vf4YrB1musoAg__4bjc,936
49
49
  gooddata_pipelines/provisioning/utils/exceptions.py,sha256=1WnAOlPhqOf0xRcvn70lxAlLb8Oo6m6WCYS4hj9uzDU,3630
50
50
  gooddata_pipelines/provisioning/utils/utils.py,sha256=_Tk-mFgbIGpCixDCF9e-3ZYd-g5Jb3SJiLSH465k4jY,2846
51
- gooddata_pipelines-1.48.1.dev2.dist-info/METADATA,sha256=wouhl67mPG9gt9dyF-oHeL1tIEHtnt5J0ANIF-Wi84I,3750
52
- gooddata_pipelines-1.48.1.dev2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
53
- gooddata_pipelines-1.48.1.dev2.dist-info/licenses/LICENSE.txt,sha256=PNC7WXGIo6OKkNoPLRxlVrw6jaLcjSTUsSxy9Xcu9Jo,560365
54
- gooddata_pipelines-1.48.1.dev2.dist-info/RECORD,,
51
+ gooddata_pipelines-1.48.1.dev4.dist-info/METADATA,sha256=Tjzry0iKQrR-LkYMX0PRWeBzXBT2XD9_8FRTMOWOMp4,3750
52
+ gooddata_pipelines-1.48.1.dev4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
53
+ gooddata_pipelines-1.48.1.dev4.dist-info/licenses/LICENSE.txt,sha256=PNC7WXGIo6OKkNoPLRxlVrw6jaLcjSTUsSxy9Xcu9Jo,560365
54
+ gooddata_pipelines-1.48.1.dev4.dist-info/RECORD,,