Skip to content

Use samekaer_session (LocalSession) in utils.py #3189

@ctselas7

Description

@ctselas7

Hello,

You give the ability to use LocalSession which is potentially really helpful. I am still struggling to make it work by using local-stack and pytests.

I find everywhere small obstacles from the code, Eg. here in utils you are recreating resources (eg s3) instead of using the s3 resource of the sagemaker_session which a user can initialize it with local s3_url_endpoint

s3 = boto_session.resource("s3", region_name=sagemaker_session.boto_region_name)

So instead of doing this

    boto_session = sagemaker_session.boto_session
    s3 = boto_session.resource("s3", region_name=boto_session.region_name)

you could simple do this if s3_resource is initialized

    s3 = sagemaker_session.s3_resource

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions