sagemaker.core.remote_function.core.stored_function#

SageMaker job function serializer/deserializer.

Classes

StoredFunction(sagemaker_session, s3_base_uri)

Class representing a remote function stored in S3.

class sagemaker.core.remote_function.core.stored_function.StoredFunction(sagemaker_session: Session, s3_base_uri: str, s3_kms_key: str | None = None, context: Context = Context(step_name=None, execution_id=None, property_references={}, serialize_output_to_json=False, func_step_s3_dir=None))[source]#

Bases: object

Class representing a remote function stored in S3.

load_and_invoke() Any[source]#

Load and deserialize the function and the arguments and then execute it.

save(func, *args, **kwargs)[source]#

Serialize and persist the function and arguments.

Parameters:
  • func – the python function.

  • args – the positional arguments to func.

  • kwargs – the keyword arguments to func.

Returns:

None

save_pipeline_step_function(serialized_data)[source]#

Upload serialized function and arguments to s3.

Parameters:

serialized_data (_SerializedData) – The serialized function and function arguments of a function step.