We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 77b37f5 commit 5b6da32Copy full SHA for 5b6da32
src/sagemaker/serializers.py
@@ -66,10 +66,10 @@ def serialize(self, data):
66
def is_sequence_like(obj):
67
return hasattr(obj, "__iter__") and hasattr(obj, "__getitem__")
68
69
- def is_mutable_sequence_like(obj):
70
- return is_sequence_like(obj) and hasattr(obj, "__setitem__")
+ is_mutable_sequence_like = is_sequence_like(data) and hasattr(data, "__setitem__")
+ has_multiple_rows = len(data) > 0 and is_sequence_like(data[0])
71
72
- if is_mutable_sequence_like(data) and len(data) > 0 and is_sequence_like(data[0]):
+ if is_mutable_sequence_like and has_multiple_rows:
73
return "\n".join([self._serialize_row(row) for row in data])
74
75
return self._serialize_row(data)
0 commit comments