-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
PySDK Version
- PySDK V2 (2.x)
- PySDK V3 (3.x)
Describe the bug
When attempting to call the invoke function with a bytes object in the body, it throws an error during serialization. This is because bytes are not treated as a primitive.
sagemaker-python-sdk/sagemaker-core/src/sagemaker/core/utils/utils.py
Lines 523 to 527 in 302b973
| elif is_not_primitive(value): | |
| # if the value is a dict, use _serialize_shape() to serialize it recursively | |
| return _serialize_shape(value) | |
| else: | |
| return value |
sagemaker-python-sdk/sagemaker-core/src/sagemaker/core/utils/utils.py
Lines 275 to 276 in 302b973
| def is_not_primitive(obj): | |
| return not isinstance(obj, (int, float, str, bool, datetime.datetime)) |
To reproduce
from sagemaker.core.utils.utils import serialize
serialize({"body": b'1'})Expected behavior
{'body': b'1'}Screenshots or logs
If applicable, add screenshots or logs to help explain your problem.
System information
A description of your system. Please provide:
- SageMaker Python SDK version: 3.6.0
- Framework name (eg. PyTorch) or algorithm (eg. KMeans): N/A
- Framework version: N/A
- Python version: 3.12.9
- CPU or GPU: N/A
- Custom Docker image (Y/N): N
Additional context
Add any other context about the problem here.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels