aws / aws/sagemaker-python-sdk

Use samekaer_session (LocalSession) in utils.py

未关闭
#3,189 0 条评论 0 个 reaction 已指派 1 人 已被 @mollyheamazon 认领 在 GitHub 查看
type: feature request type: maintenance
主要语言
Python
星标
2.3k
派生
1.3k
平均合并
1 天 22 小时
30 天内合并 PR
35

描述

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`
https://github.com/aws/sagemaker-python-sdk/blob/72c12bb1481c368f799b17c38d07c5fc34864093/src/sagemaker/utils.py#L532

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
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。