aws / aws/sagemaker-python-sdk

Use samekaer_session (LocalSession) in utils.py

Abierto
#3,189 0 comentarios 0 reacciones 1 asignado Reclamado por @mollyheamazon Ver en GitHub
type: feature request type: maintenance
Lenguaje dominante
Python
Estrellas
2.3k
Forks
1.3k
Merge medio
1 d 22 h
PR fusionados (30 d)
35

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.