aws / aws/sagemaker-python-sdk

Use samekaer_session (LocalSession) in utils.py

オープン
#3,189 コメント 0 件 リアクション 0 件 担当者 1 名 @mollyheamazon が担当を希望しています GitHub で見る
type: feature request type: maintenance
主要言語
Python
スター
2.3k
フォーク
1.3k
平均マージ
1日 22時間
マージ済み PR(30日)
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 を短くまとめたダイジェスト。