sagemaker-core 1.0.1__py3-none-any.whl → 1.0.2__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.

@@ -18,7 +18,7 @@ from sagemaker_core.main.utils import Unassigned
18
18
 
19
19
 
20
20
  class Base(BaseModel):
21
- model_config = ConfigDict(protected_namespaces=(), validate_assignment=True)
21
+ model_config = ConfigDict(protected_namespaces=(), validate_assignment=True, extra="forbid")
22
22
 
23
23
 
24
24
  class ActionSource(Base):
@@ -3055,7 +3055,7 @@ class ContainerDefinition(Base):
3055
3055
  model_data_url: The S3 path where the model artifacts, which result from model training, are stored. This path must point to a single gzip compressed tar archive (.tar.gz suffix). The S3 path is required for SageMaker built-in algorithms, but not if you use your own algorithms. For more information on built-in algorithms, see Common Parameters. The model artifacts must be in an S3 bucket that is in the same region as the model or endpoint you are creating. If you provide a value for this parameter, SageMaker uses Amazon Web Services Security Token Service to download model artifacts from the S3 path you provide. Amazon Web Services STS is activated in your Amazon Web Services account by default. If you previously deactivated Amazon Web Services STS for a region, you need to reactivate Amazon Web Services STS for that region. For more information, see Activating and Deactivating Amazon Web Services STS in an Amazon Web Services Region in the Amazon Web Services Identity and Access Management User Guide. If you use a built-in algorithm to create a model, SageMaker requires that you provide a S3 path to the model artifacts in ModelDataUrl.
3056
3056
  model_data_source: Specifies the location of ML model data to deploy. Currently you cannot use ModelDataSource in conjunction with SageMaker batch transform, SageMaker serverless endpoints, SageMaker multi-model endpoints, and SageMaker Marketplace.
3057
3057
  additional_model_data_sources: Data sources that are available to your model in addition to the one that you specify for ModelDataSource when you use the CreateModel action.
3058
- environment: The environment variables to set in the Docker container. The maximum length of each key and value in the Environment map is 1024 bytes. The maximum length of all keys and values in the map, combined, is 32 KB. If you pass multiple containers to a CreateModel request, then the maximum length of all of their maps, combined, is also 32 KB.
3058
+ environment: The environment variables to set in the Docker container. Don't include any sensitive data in your environment variables. The maximum length of each key and value in the Environment map is 1024 bytes. The maximum length of all keys and values in the map, combined, is 32 KB. If you pass multiple containers to a CreateModel request, then the maximum length of all of their maps, combined, is also 32 KB.
3059
3059
  model_package_name: The name or Amazon Resource Name (ARN) of the model package to use to create the model.
3060
3060
  inference_specification_name: The inference specification name in the model package version.
3061
3061
  multi_model_config: Specifies additional configuration for multi-model endpoints.
@@ -3856,6 +3856,7 @@ class UserSettings(Base):
3856
3856
  custom_posix_user_config: Details about the POSIX identity that is used for file system operations.
3857
3857
  custom_file_system_configs: The settings for assigning a custom file system to a user profile. Permitted users can access this file system in Amazon SageMaker Studio.
3858
3858
  studio_web_portal_settings: Studio settings. If these settings are applied on a user level, they take priority over the settings applied on a domain level.
3859
+ auto_mount_home_efs: Indicates whether auto-mounting of an EFS volume is supported for the user profile. The DefaultAsDomain value is only supported for user profiles. Do not use the DefaultAsDomain value when setting this parameter for a domain.
3859
3860
  """
3860
3861
 
3861
3862
  execution_role: Optional[str] = Unassigned()
@@ -3875,6 +3876,7 @@ class UserSettings(Base):
3875
3876
  custom_posix_user_config: Optional[CustomPosixUserConfig] = Unassigned()
3876
3877
  custom_file_system_configs: Optional[List[CustomFileSystemConfig]] = Unassigned()
3877
3878
  studio_web_portal_settings: Optional[StudioWebPortalSettings] = Unassigned()
3879
+ auto_mount_home_efs: Optional[str] = Unassigned()
3878
3880
 
3879
3881
 
3880
3882
  class RStudioServerProDomainSettings(Base):
@@ -267,7 +267,7 @@ def pascal_to_snake(pascal_str):
267
267
 
268
268
 
269
269
  def is_not_primitive(obj):
270
- return not isinstance(obj, (int, float, str, bool, complex))
270
+ return not isinstance(obj, (int, float, str, bool, datetime.datetime))
271
271
 
272
272
 
273
273
  def is_not_str_dict(obj):
@@ -438,6 +438,11 @@ class ResourceIterator(Generic[T]):
438
438
 
439
439
  if self.custom_key_mapping:
440
440
  init_data = {self.custom_key_mapping.get(k, k): v for k, v in init_data.items()}
441
+
442
+ # Filter out the fields that are not in the resource class
443
+ fields = self.resource_cls.__annotations__
444
+ init_data = {k: v for k, v in init_data.items() if k in fields}
445
+
441
446
  resource_object = self.resource_cls(**init_data)
442
447
 
443
448
  # If the resource object has refresh method, refresh and return it
@@ -56,7 +56,6 @@ from sagemaker_core.tools.templates import (
56
56
  RESOURCE_BASE_CLASS_TEMPLATE,
57
57
  RETURN_ITERATOR_TEMPLATE,
58
58
  SERIALIZE_INPUT_TEMPLATE,
59
- SERIALIZE_LIST_INPUT_TEMPLATE,
60
59
  STOP_METHOD_TEMPLATE,
61
60
  DELETE_METHOD_TEMPLATE,
62
61
  WAIT_FOR_DELETE_METHOD_TEMPLATE,
@@ -897,7 +896,8 @@ class ResourcesCodeGen:
897
896
  resource_name=resource_name,
898
897
  create_args=create_args,
899
898
  resource_lower=resource_lower,
900
- service_name="sagemaker", # TODO: change service name based on the service - runtime, sagemaker, etc.
899
+ # TODO: change service name based on the service - runtime, sagemaker, etc.
900
+ service_name="sagemaker",
901
901
  operation_input_args=operation_input_args,
902
902
  operation=operation,
903
903
  get_args=get_args,
@@ -908,7 +908,8 @@ class ResourcesCodeGen:
908
908
  resource_name=resource_name,
909
909
  create_args=create_args,
910
910
  resource_lower=resource_lower,
911
- service_name="sagemaker", # TODO: change service name based on the service - runtime, sagemaker, etc.
911
+ # TODO: change service name based on the service - runtime, sagemaker, etc.
912
+ service_name="sagemaker",
912
913
  operation_input_args=operation_input_args,
913
914
  operation=operation,
914
915
  get_args=get_args,
@@ -1074,7 +1075,8 @@ class ResourcesCodeGen:
1074
1075
  resource_name=resource_name,
1075
1076
  import_args=import_args,
1076
1077
  resource_lower=resource_lower,
1077
- service_name="sagemaker", # TODO: change service name based on the service - runtime, sagemaker, etc.
1078
+ # TODO: change service name based on the service - runtime, sagemaker, etc.
1079
+ service_name="sagemaker",
1078
1080
  operation_input_args=operation_input_args,
1079
1081
  operation=operation,
1080
1082
  get_args=get_args,
@@ -1378,7 +1380,8 @@ class ResourcesCodeGen:
1378
1380
  formatted_method = GET_METHOD_TEMPLATE.format(
1379
1381
  docstring=docstring,
1380
1382
  resource_name=resource_name,
1381
- service_name="sagemaker", # TODO: change service name based on the service - runtime, sagemaker, etc.
1383
+ # TODO: change service name based on the service - runtime, sagemaker, etc.
1384
+ service_name="sagemaker",
1382
1385
  describe_args=describe_args,
1383
1386
  resource_lower=resource_lower,
1384
1387
  operation_input_args=operation_input_args,
@@ -1686,7 +1689,7 @@ class ResourcesCodeGen:
1686
1689
 
1687
1690
  resource_iterator_args = ",\n".join(resource_iterator_args_list)
1688
1691
  resource_iterator_args = add_indent(resource_iterator_args, 8)
1689
- serialize_operation_input = SERIALIZE_LIST_INPUT_TEMPLATE.format(
1692
+ serialize_operation_input = SERIALIZE_INPUT_TEMPLATE.format(
1690
1693
  operation_input_args=operation_input_args
1691
1694
  )
1692
1695
  initialize_client = INITIALIZE_CLIENT_TEMPLATE.format(service_name=method.service_name)
@@ -291,6 +291,10 @@ def get(
291
291
  operation_input_args = {{
292
292
  {operation_input_args}
293
293
  }}
294
+ # serialize the input request
295
+ operation_input_args = serialize(operation_input_args)
296
+ logger.debug(f"Serialized input request: {{operation_input_args}}")
297
+
294
298
  client = Base.get_sagemaker_client(session=session, region_name=region, service_name='{service_name}')
295
299
  response = client.{operation}(**operation_input_args)
296
300
 
@@ -312,6 +316,10 @@ def refresh(
312
316
  operation_input_args = {{
313
317
  {operation_input_args}
314
318
  }}
319
+ # serialize the input request
320
+ operation_input_args = serialize(operation_input_args)
321
+ logger.debug(f"Serialized input request: {{operation_input_args}}")
322
+
315
323
  client = Base.get_sagemaker_client()
316
324
  response = client.{operation}(**operation_input_args)
317
325
 
@@ -497,6 +505,10 @@ def delete(
497
505
  operation_input_args = {{
498
506
  {operation_input_args}
499
507
  }}
508
+ # serialize the input request
509
+ operation_input_args = serialize(operation_input_args)
510
+ logger.debug(f"Serialized input request: {{operation_input_args}}")
511
+
500
512
  client.{operation}(**operation_input_args)
501
513
 
502
514
  logger.info(f"Deleting {{self.__class__.__name__}} - {{self.get_name()}}")
@@ -511,6 +523,10 @@ def stop(self) -> None:
511
523
  operation_input_args = {{
512
524
  {operation_input_args}
513
525
  }}
526
+ # serialize the input request
527
+ operation_input_args = serialize(operation_input_args)
528
+ logger.debug(f"Serialized input request: {{operation_input_args}}")
529
+
514
530
  client.{operation}(**operation_input_args)
515
531
 
516
532
  logger.info(f"Stopping {{self.__class__.__name__}} - {{self.get_name()}}")
@@ -532,7 +548,9 @@ def get_all(
532
548
  {operation_input_args}
533
549
  }}
534
550
  {custom_key_mapping}
535
- operation_input_args = {{k: v for k, v in operation_input_args.items() if v is not None and not isinstance(v, Unassigned)}}
551
+ # serialize the input request
552
+ operation_input_args = serialize(operation_input_args)
553
+ logger.debug(f"Serialized input request: {{operation_input_args}}")
536
554
 
537
555
  return ResourceIterator(
538
556
  {resource_iterator_args}
@@ -582,7 +600,9 @@ SERIALIZE_INPUT_TEMPLATE = """
582
600
  operation_input_args = {{
583
601
  {operation_input_args}
584
602
  }}
585
- logger.debug(f"Input request: {{operation_input_args}}")"""
603
+ # serialize the input request
604
+ operation_input_args = serialize(operation_input_args)
605
+ logger.debug(f"Serialized input request: {{operation_input_args}}")"""
586
606
 
587
607
  INITIALIZE_CLIENT_TEMPLATE = """
588
608
  client = Base.get_sagemaker_client(session=session, region_name=region, service_name='{service_name}')"""
@@ -604,13 +624,6 @@ DESERIALIZE_RESPONSE_TEMPLATE = """
604
624
  DESERIALIZE_RESPONSE_TO_BASIC_TYPE_TEMPLATE = """
605
625
  return list(response.values())[0]"""
606
626
 
607
- SERIALIZE_LIST_INPUT_TEMPLATE = """
608
- operation_input_args = {{
609
- {operation_input_args}
610
- }}
611
- operation_input_args = {{k: v for k, v in operation_input_args.items() if v is not None and not isinstance(v, Unassigned)}}
612
- logger.debug(f"Input request: {{operation_input_args}}")"""
613
-
614
627
  RETURN_ITERATOR_TEMPLATE = """
615
628
  return ResourceIterator(
616
629
  {resource_iterator_args}
@@ -622,7 +635,7 @@ DESERIALIZE_INPUT_AND_RESPONSE_TO_CLS_TEMPLATE = """
622
635
 
623
636
  RESOURCE_BASE_CLASS_TEMPLATE = """
624
637
  class Base(BaseModel):
625
- model_config = ConfigDict(protected_namespaces=(), validate_assignment=True)
638
+ model_config = ConfigDict(protected_namespaces=(), validate_assignment=True, extra="forbid")
626
639
 
627
640
  @classmethod
628
641
  def get_sagemaker_client(cls, session = None, region_name = None, service_name = 'sagemaker'):
@@ -709,7 +722,7 @@ class Base(BaseModel):
709
722
 
710
723
  SHAPE_BASE_CLASS_TEMPLATE = """
711
724
  class {class_name}:
712
- model_config = ConfigDict(protected_namespaces=(), validate_assignment=True)
725
+ model_config = ConfigDict(protected_namespaces=(), validate_assignment=True, extra="forbid")
713
726
  """
714
727
 
715
728
  SHAPE_CLASS_TEMPLATE = '''
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sagemaker-core
3
- Version: 1.0.1
3
+ Version: 1.0.2
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
@@ -6,15 +6,15 @@ sagemaker_core/main/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
6
6
  sagemaker_core/main/config_schema.py,sha256=IDvL1YuMOwVg4nb0D4ysU51tc1UjlQASyz1QZoncs7I,56907
7
7
  sagemaker_core/main/exceptions.py,sha256=87DUlrmHxaWoiYNlpNY9ixxFMPRk_dIGPsA2e_xdVwQ,5602
8
8
  sagemaker_core/main/intelligent_defaults_helper.py,sha256=5SDM6UavZtp-k5LhqRL7GRIDgzFB5UsC_p7YuiSPK9A,8334
9
- sagemaker_core/main/resources.py,sha256=ttv1ikhwharh6M2Y3BQcyUIki_w2KgaXONri57NoWrI,1262774
10
- sagemaker_core/main/shapes.py,sha256=dBS_gTcdZWe3oQwgT0Jm5yW4xtXTaoe6W75vcP0kMnk,679075
9
+ sagemaker_core/main/resources.py,sha256=_zix3PucNO60z3XVLEKCfSm5zWLyNWJaaGk868-rz5w,1298170
10
+ sagemaker_core/main/shapes.py,sha256=c0B7r7_xz3m2CDc_Dmh1CjczmhCmwwzL8yaeLoWc7vs,679460
11
11
  sagemaker_core/main/user_agent.py,sha256=4sZybDXkzRoZnOnVDQ8p8zFTfiRJdsH7amDWInVQ4xU,2708
12
- sagemaker_core/main/utils.py,sha256=5FDSaXVi_GdluRfwhlZdVUfb23ROrLzaCG-deCJPDy0,18614
12
+ sagemaker_core/main/utils.py,sha256=I7WsC-DdbnAZg_PtqcLPywXlqjAwj7ZYbeHhv93Z1O4,18840
13
13
  sagemaker_core/main/code_injection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  sagemaker_core/main/code_injection/base.py,sha256=11_Jif0nOzfbLGlXaacKf-wcizzfS64U0OSZGoVffFU,1733
15
15
  sagemaker_core/main/code_injection/codec.py,sha256=2DjmeD2uND307UqDefvVEpE0rZ8yfFU3Bi3TvQCQveI,7658
16
16
  sagemaker_core/main/code_injection/constants.py,sha256=2ICExGge8vAWx7lSTW0JGh-bH1korkvpOpDu5M63eI4,980
17
- sagemaker_core/main/code_injection/shape_dag.py,sha256=hqLwJzyLv7MHHr7wZudSn8zG3YbBKTqILUb5UVQCjC8,645192
17
+ sagemaker_core/main/code_injection/shape_dag.py,sha256=oM_xL5qx9nQmWIWbtNurVsz6UXMfpIfrUyw7ZIc3Ry4,645281
18
18
  sagemaker_core/resources/__init__.py,sha256=EAYTFMN-nPjnPjjBbhIUeaL67FLKNPd7qbcbl9VIrws,31
19
19
  sagemaker_core/shapes/__init__.py,sha256=RnbIu9eTxKt-DNsOFJabrWIgrrtS9_SdAozP9JBl_ic,28
20
20
  sagemaker_core/tools/__init__.py,sha256=xX79JImxCVzrWMnjgntLCve2G5I-R4pRar5s20kT9Rs,56
@@ -22,13 +22,13 @@ sagemaker_core/tools/codegen.py,sha256=mKWVi2pWnPxyIoWUEPYjEc9Gw7D9bCOrHqa00yzIZ
22
22
  sagemaker_core/tools/constants.py,sha256=PCyf5MCkWYL4dDmIMKZw8QD7FcF8HqYwK-gnJ1Fdno0,2989
23
23
  sagemaker_core/tools/data_extractor.py,sha256=NpP22uCaWgvn9uOHsFEkgtn3h2nOIKDvJTLihN01f1A,1368
24
24
  sagemaker_core/tools/method.py,sha256=4Hmu4UWpiBgUTZljYdW1KIKDduDxf_nfhCyuWgLVMWI,717
25
- sagemaker_core/tools/resources_codegen.py,sha256=CZTjshFdSek0zTYIMB3HxyGnPmqpixs2Q1XflBS50w0,89954
25
+ sagemaker_core/tools/resources_codegen.py,sha256=m7B2vrkfokLmzND9tCkty7EhVMk1FLevTd2LmJd_GKg,89974
26
26
  sagemaker_core/tools/resources_extractor.py,sha256=B9Twlf2vb7AkZUKLnxSdQZ_rNLPz0ROk9kuq-6uB1As,14526
27
27
  sagemaker_core/tools/shapes_codegen.py,sha256=_ve959bwH8usZ6dPlpXxi2on9t0hLpcmhRWnaWHCWMQ,11745
28
28
  sagemaker_core/tools/shapes_extractor.py,sha256=4KjgDmhlPM4G1f1NeYbORKlXs1s7Q_sm_NK31S_ROQ0,11950
29
- sagemaker_core/tools/templates.py,sha256=1oMfDD1JBp2ImA6cQwc8w9CHBmAUH2WnEtefPNFwb34,24066
30
- sagemaker_core-1.0.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
31
- sagemaker_core-1.0.1.dist-info/METADATA,sha256=Ze-1qi1eHRDx14GSKoXYzmBKnjLqjwlb_C9T0Gu99CU,4645
32
- sagemaker_core-1.0.1.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
33
- sagemaker_core-1.0.1.dist-info/top_level.txt,sha256=R3GAZZ1zC5JxqdE_0x2Lu_WYi2Xfke7VsiP3L5zngfA,15
34
- sagemaker_core-1.0.1.dist-info/RECORD,,
29
+ sagemaker_core/tools/templates.py,sha256=IvL9ykLvOXDNCMnIZn30o-6Cmx4fw-BIJz3nl9LD4dc,24614
30
+ sagemaker_core-1.0.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
31
+ sagemaker_core-1.0.2.dist-info/METADATA,sha256=2CiwzWSqo3XyV_tlMy8ZWIsvq3Pzovrxx8SY4j9JJLY,4645
32
+ sagemaker_core-1.0.2.dist-info/WHEEL,sha256=uCRv0ZEik_232NlR4YDw4Pv3Ajt5bKvMH13NUU7hFuI,91
33
+ sagemaker_core-1.0.2.dist-info/top_level.txt,sha256=R3GAZZ1zC5JxqdE_0x2Lu_WYi2Xfke7VsiP3L5zngfA,15
34
+ sagemaker_core-1.0.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.0.0)
2
+ Generator: setuptools (74.1.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5