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

Default Value for NextToken in SageMaker.Client.list_model_packages #4245

Closed
2 tasks
newTypeGeek opened this issue Aug 22, 2024 · 5 comments
Closed
2 tasks
Assignees
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. feature-request This issue requests a feature. p2 This is a standard priority issue response-requested Waiting on additional information or feedback. sagemaker

Comments

@newTypeGeek
Copy link

Describe the feature

For SageMaker.Client.list_model_packages, the argument NextToken is expected to be a string. And it is used to retrieve subsequent model package summary, like pagination.

I would like to know if it accepts default value (e.g. empty string, or None or any others) to indicate it is the first retrieval. Having such feature could simplify the code.

Use Case

The use case is using a while loop to keep retrieving the model package summary without using If else to handle the first retrieval

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

1.34.142

Environment details (OS name and version, etc.)

macOS Sonoma 14.6.1

@newTypeGeek newTypeGeek added feature-request This issue requests a feature. needs-triage This issue or PR still needs to be triaged. labels Aug 22, 2024
@tim-finnigan tim-finnigan self-assigned this Aug 23, 2024
@tim-finnigan
Copy link
Contributor

Thanks for reaching out. Have you tried using the paginator to meet your use case? For example:

import boto3

s3 = boto3.client('sagemaker')
paginator = s3.get_paginator('list_model_packages')
response_iterator = paginator.paginate()

for response in response_iterator:
    print(response)

For more info on paginators you can refer to https://boto3.amazonaws.com/v1/documentation/api/latest/guide/paginators.html.

@tim-finnigan tim-finnigan added response-requested Waiting on additional information or feedback. sagemaker p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Aug 23, 2024
Copy link

github-actions bot commented Sep 3, 2024

Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Sep 3, 2024
@newTypeGeek
Copy link
Author

Thanks for reaching out. Have you tried using the paginator to meet your use case? For example:

import boto3

s3 = boto3.client('sagemaker')
paginator = s3.get_paginator('list_model_packages')
response_iterator = paginator.paginate()

for response in response_iterator:
    print(response)

For more info on paginators you can refer to https://boto3.amazonaws.com/v1/documentation/api/latest/guide/paginators.html.

Thanks, it works for me :)

@tim-finnigan
Copy link
Contributor

Thanks for letting us know, I'll close this since the paginator meets your use case.

Copy link

github-actions bot commented Sep 4, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. feature-request This issue requests a feature. p2 This is a standard priority issue response-requested Waiting on additional information or feedback. sagemaker
Projects
None yet
Development

No branches or pull requests

2 participants