Skip to content

AsyncPredictor fails if name is None, despite it being the default #4774

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

Open
david-waterworth opened this issue Jul 5, 2024 · 1 comment

Comments

@david-waterworth
Copy link

Describe the bug

The name argument of the AsyncPredictor.__init__.py is optional with default=None

But calling async_predictor.predict(data=...) requires name to be non-null, i.e._upload_data_to_s3 calls name_from_base on self.name which fails if name is None (i.e. the default)

To reproduce

from sagemaker.predictor import Predictor
from sagemaker.predictor_async import AsyncPredictor

predictor = Predictor(endpoint_name=endpoint_name, sagemaker_session=sagemaker_session)
async_predictor = AsyncPredictor(predictor)

result = async_predictor.predict(data=request_body)

TypeError: 'NoneType' object is not subscriptable

Expected behavior
The name field of AsyncPredictor should have a "non-None" default (a guid, or the endpoint name?)

System information
A description of your system. Please provide:

  • SageMaker Python SDK version: '2.224.2'
  • Framework name (eg. PyTorch) or algorithm (eg. KMeans): PyTorch / Triton (custom inference container)
  • Framework version:
  • Python version:
  • CPU or GPU:
  • Custom Docker image (Y/N): Y

Additional context
Add any other context about the problem here.

@AFZL210
Copy link

AFZL210 commented May 17, 2025

If this is the case, then all the folks who are using AsyncPredictor must have faced this and passed the name argument.

Shouldn't the name be required instead of setting a default guid?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants