sagemaker-core 1.0.60__py3-none-any.whl → 1.0.61__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 sagemaker-core might be problematic. Click here for more details.

@@ -4213,6 +4213,10 @@ SHAPE_DAG = {
4213
4213
  "members": [{"name": "PipelineArn", "shape": "PipelineArn", "type": "string"}],
4214
4214
  "type": "structure",
4215
4215
  },
4216
+ "DeleteProcessingJobRequest": {
4217
+ "members": [{"name": "ProcessingJobName", "shape": "ProcessingJobName", "type": "string"}],
4218
+ "type": "structure",
4219
+ },
4216
4220
  "DeleteProjectInput": {
4217
4221
  "members": [{"name": "ProjectName", "shape": "ProjectEntityName", "type": "string"}],
4218
4222
  "type": "structure",
@@ -4252,6 +4256,10 @@ SHAPE_DAG = {
4252
4256
  "type": "structure",
4253
4257
  },
4254
4258
  "DeleteTagsOutput": {"members": [], "type": "structure"},
4259
+ "DeleteTrainingJobRequest": {
4260
+ "members": [{"name": "TrainingJobName", "shape": "TrainingJobName", "type": "string"}],
4261
+ "type": "structure",
4262
+ },
4255
4263
  "DeleteTrialComponentRequest": {
4256
4264
  "members": [
4257
4265
  {"name": "TrialComponentName", "shape": "ExperimentEntityName", "type": "string"}
@@ -26308,6 +26308,40 @@ class ProcessingJob(Base):
26308
26308
  transform(response, "DescribeProcessingJobResponse", self)
26309
26309
  return self
26310
26310
 
26311
+ @Base.add_validate_call
26312
+ def delete(
26313
+ self,
26314
+ ) -> None:
26315
+ """
26316
+ Delete a ProcessingJob resource
26317
+
26318
+ Raises:
26319
+ botocore.exceptions.ClientError: This exception is raised for AWS service related errors.
26320
+ The error message and error code can be parsed from the exception as follows:
26321
+ ```
26322
+ try:
26323
+ # AWS service call here
26324
+ except botocore.exceptions.ClientError as e:
26325
+ error_message = e.response['Error']['Message']
26326
+ error_code = e.response['Error']['Code']
26327
+ ```
26328
+ ResourceInUse: Resource being accessed is in use.
26329
+ ResourceNotFound: Resource being access is not found.
26330
+ """
26331
+
26332
+ client = Base.get_sagemaker_client()
26333
+
26334
+ operation_input_args = {
26335
+ "ProcessingJobName": self.processing_job_name,
26336
+ }
26337
+ # serialize the input request
26338
+ operation_input_args = serialize(operation_input_args)
26339
+ logger.debug(f"Serialized input request: {operation_input_args}")
26340
+
26341
+ client.delete_processing_job(**operation_input_args)
26342
+
26343
+ logger.info(f"Deleting {self.__class__.__name__} - {self.get_name()}")
26344
+
26311
26345
  @Base.add_validate_call
26312
26346
  def stop(self) -> None:
26313
26347
  """
@@ -28708,6 +28742,40 @@ class TrainingJob(Base):
28708
28742
 
28709
28743
  return self
28710
28744
 
28745
+ @Base.add_validate_call
28746
+ def delete(
28747
+ self,
28748
+ ) -> None:
28749
+ """
28750
+ Delete a TrainingJob resource
28751
+
28752
+ Raises:
28753
+ botocore.exceptions.ClientError: This exception is raised for AWS service related errors.
28754
+ The error message and error code can be parsed from the exception as follows:
28755
+ ```
28756
+ try:
28757
+ # AWS service call here
28758
+ except botocore.exceptions.ClientError as e:
28759
+ error_message = e.response['Error']['Message']
28760
+ error_code = e.response['Error']['Code']
28761
+ ```
28762
+ ResourceInUse: Resource being accessed is in use.
28763
+ ResourceNotFound: Resource being access is not found.
28764
+ """
28765
+
28766
+ client = Base.get_sagemaker_client()
28767
+
28768
+ operation_input_args = {
28769
+ "TrainingJobName": self.training_job_name,
28770
+ }
28771
+ # serialize the input request
28772
+ operation_input_args = serialize(operation_input_args)
28773
+ logger.debug(f"Serialized input request: {operation_input_args}")
28774
+
28775
+ client.delete_training_job(**operation_input_args)
28776
+
28777
+ logger.info(f"Deleting {self.__class__.__name__} - {self.get_name()}")
28778
+
28711
28779
  @Base.add_validate_call
28712
28780
  def stop(self) -> None:
28713
28781
  """
@@ -28822,6 +28890,69 @@ class TrainingJob(Base):
28822
28890
  raise TimeoutExceededError(resouce_type="TrainingJob", status=current_status)
28823
28891
  time.sleep(poll)
28824
28892
 
28893
+ @Base.add_validate_call
28894
+ def wait_for_delete(
28895
+ self,
28896
+ poll: int = 5,
28897
+ timeout: Optional[int] = None,
28898
+ ) -> None:
28899
+ """
28900
+ Wait for a TrainingJob resource to be deleted.
28901
+
28902
+ Parameters:
28903
+ poll: The number of seconds to wait between each poll.
28904
+ timeout: The maximum number of seconds to wait before timing out.
28905
+
28906
+ Raises:
28907
+ botocore.exceptions.ClientError: This exception is raised for AWS service related errors.
28908
+ The error message and error code can be parsed from the exception as follows:
28909
+ ```
28910
+ try:
28911
+ # AWS service call here
28912
+ except botocore.exceptions.ClientError as e:
28913
+ error_message = e.response['Error']['Message']
28914
+ error_code = e.response['Error']['Code']
28915
+ ```
28916
+ TimeoutExceededError: If the resource does not reach a terminal state before the timeout.
28917
+ DeleteFailedStatusError: If the resource reaches a failed state.
28918
+ WaiterError: Raised when an error occurs while waiting.
28919
+ """
28920
+ start_time = time.time()
28921
+
28922
+ progress = Progress(
28923
+ SpinnerColumn("bouncingBar"),
28924
+ TextColumn("{task.description}"),
28925
+ TimeElapsedColumn(),
28926
+ )
28927
+ progress.add_task("Waiting for TrainingJob to be deleted...")
28928
+ status = Status("Current status:")
28929
+
28930
+ with Live(
28931
+ Panel(
28932
+ Group(progress, status),
28933
+ title="Wait Log Panel",
28934
+ border_style=Style(color=Color.BLUE.value),
28935
+ )
28936
+ ):
28937
+ while True:
28938
+ try:
28939
+ self.refresh()
28940
+ current_status = self.training_job_status
28941
+ status.update(f"Current status: [bold]{current_status}")
28942
+
28943
+ if timeout is not None and time.time() - start_time >= timeout:
28944
+ raise TimeoutExceededError(
28945
+ resouce_type="TrainingJob", status=current_status
28946
+ )
28947
+ except botocore.exceptions.ClientError as e:
28948
+ error_code = e.response["Error"]["Code"]
28949
+
28950
+ if "ResourceNotFound" in error_code or "ValidationException" in error_code:
28951
+ logger.info("Resource was not found. It may have been deleted.")
28952
+ return
28953
+ raise e
28954
+ time.sleep(poll)
28955
+
28825
28956
  @classmethod
28826
28957
  @Base.add_validate_call
28827
28958
  def get_all(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sagemaker-core
3
- Version: 1.0.60
3
+ Version: 1.0.61
4
4
  Summary: An python package for sagemaker core functionalities
5
5
  Author-email: AWS <sagemaker-interests@amazon.com>
6
6
  Project-URL: Repository, https://github.com/aws/sagemaker-core.git
@@ -7,7 +7,7 @@ sagemaker_core/main/config_schema.py,sha256=1xYzDM0FEBQFmiE3R--Nj0_RMQQF3vxlFQXE
7
7
  sagemaker_core/main/default_configs_helper.py,sha256=bg_tgczX_bYzNiSlalJ6TWPTgrQYsI0uZguP5TIbPiw,8324
8
8
  sagemaker_core/main/exceptions.py,sha256=CsiM3V_Gb16grBotnu59LB6tznryPcSvAQDAOOYGc10,5563
9
9
  sagemaker_core/main/logs.py,sha256=yfEH7uP91nbE1lefymOlBr81ziBzsDSIOF2Qyd54FJE,6241
10
- sagemaker_core/main/resources.py,sha256=wUFDZG_V3kbbfVsqAzNEIhnAXuiFwdNkQAvRadca2oI,1445487
10
+ sagemaker_core/main/resources.py,sha256=rGUGdaFbj0k0jMaYmqv7pFXR7kO73LE8i0k4FRwpu28,1450476
11
11
  sagemaker_core/main/shapes.py,sha256=zYSg0Y41FJIYRfWYcuekcAS8qDyr2SA3hWeFmDDQFro,790466
12
12
  sagemaker_core/main/user_agent.py,sha256=BPYDAfDd70ObP-VAjl7aDHALHyGknkpRP21ktVr_LDw,2744
13
13
  sagemaker_core/main/utils.py,sha256=y1aZzztCApczZSqT0U7_H8zLlpqp1vgoUKcp40mTM2o,19157
@@ -15,7 +15,7 @@ sagemaker_core/main/code_injection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQe
15
15
  sagemaker_core/main/code_injection/base.py,sha256=11_Jif0nOzfbLGlXaacKf-wcizzfS64U0OSZGoVffFU,1733
16
16
  sagemaker_core/main/code_injection/codec.py,sha256=2YzJ-iYEzmguVaJVcZeyCR0OpTSR7UOixATrOm4MiBk,8885
17
17
  sagemaker_core/main/code_injection/constants.py,sha256=2ICExGge8vAWx7lSTW0JGh-bH1korkvpOpDu5M63eI4,980
18
- sagemaker_core/main/code_injection/shape_dag.py,sha256=-DKZK8MtIAJktSDvhiAsF8DYc4ivyyOBxVoFJjtAyiw,749202
18
+ sagemaker_core/main/code_injection/shape_dag.py,sha256=OpcqoAYrZqj1UQTC9zMswN6yHNBE1wERgMb8lxGdnIA,749540
19
19
  sagemaker_core/resources/__init__.py,sha256=EAYTFMN-nPjnPjjBbhIUeaL67FLKNPd7qbcbl9VIrws,31
20
20
  sagemaker_core/shapes/__init__.py,sha256=RnbIu9eTxKt-DNsOFJabrWIgrrtS9_SdAozP9JBl_ic,28
21
21
  sagemaker_core/tools/__init__.py,sha256=xX79JImxCVzrWMnjgntLCve2G5I-R4pRar5s20kT9Rs,56
@@ -28,8 +28,8 @@ sagemaker_core/tools/resources_extractor.py,sha256=hN61ehZbPnhFW-2FIVDi7NsEz4rLv
28
28
  sagemaker_core/tools/shapes_codegen.py,sha256=4lsePZpjk7M6RpJs5yar_m4z5MzwGHFrvCkdS_-R12c,12172
29
29
  sagemaker_core/tools/shapes_extractor.py,sha256=vxVKjXD3lmjrkoKiexjUnOt8ITbFxQSeiDtx7P6Qtkw,14226
30
30
  sagemaker_core/tools/templates.py,sha256=0lOIH3Rq2CXWkQhK6VenN_TE_v5p852s2kQyb_BeQxA,23460
31
- sagemaker_core-1.0.60.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
32
- sagemaker_core-1.0.60.dist-info/METADATA,sha256=mCQybM_CzRX59r63LN7VhYir8D2dzxC4IjqcLFxti_w,4871
33
- sagemaker_core-1.0.60.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
34
- sagemaker_core-1.0.60.dist-info/top_level.txt,sha256=R3GAZZ1zC5JxqdE_0x2Lu_WYi2Xfke7VsiP3L5zngfA,15
35
- sagemaker_core-1.0.60.dist-info/RECORD,,
31
+ sagemaker_core-1.0.61.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
32
+ sagemaker_core-1.0.61.dist-info/METADATA,sha256=IVqhfrvHAoF1JkY_i682zCGoCKRzLPfTxuELnMSlgv4,4871
33
+ sagemaker_core-1.0.61.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
34
+ sagemaker_core-1.0.61.dist-info/top_level.txt,sha256=R3GAZZ1zC5JxqdE_0x2Lu_WYi2Xfke7VsiP3L5zngfA,15
35
+ sagemaker_core-1.0.61.dist-info/RECORD,,