Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SageMaker Unified Studio: default_bucket returning incorrect bucket and default_bucket_prefix returning None from sagemaker_core python SDK #237

Open
marfriaz opened this issue Jan 31, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@marfriaz
Copy link

marfriaz commented Jan 31, 2025

Describe the bug
default_bucket returning incorrect bucket and default_bucket_prefix returning None from sagemaker_core python SDK in SageMaker Unified Studio. This works fine in sagemaker python sdk.

As a temporary workaround, this commit has been merged: aws/amazon-sagemaker-examples@ccdfae2

To reproduce
In a JupyterLab notebook running in SageMaker Unified Studio

from sagemaker_core.helper.session_helper import get_execution_role, Session

sagemaker_session = Session()

s3_bucket_name = sagemaker_session.default_bucket()
default_bucket_prefix = sagemaker_session.default_bucket_prefix

print(f"Test s3_bucket_name: {s3_bucket_name}")
# Prints something like sagemaker-us-east-2-715841365766, when it should print something likeamazon-sagemaker-715841365766-us-east-2-018ae31e0f88

print(f"Test default_bucket_prefix: {default_bucket_prefix}")
# Prints None, when it should print a string

Expected behavior
In psuedocode above.

Additional info
This commit may be updated to pull default_bucket and default_bucket_prefix from sagemaker_core instead of sagemaker once this issue has been fixed.

@marfriaz marfriaz added the bug Something isn't working label Jan 31, 2025
@marfriaz marfriaz changed the title SageMaker Unified Studio: default_bucket and default_bucket_prefix returning None from sagemaker_core python SDK SageMaker Unified Studio: default_bucket returning incorrect bucket and default_bucket_prefix returning None from sagemaker_core python SDK Jan 31, 2025
@benieric
Copy link
Collaborator

After we make this fix we should update this example notebook to use sagemaker core session again - aws/amazon-sagemaker-examples#4812

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants