Skip to content

Commit 57f020e

Browse files
author
Balaji Veeramani
committed
Update serializers.py
1 parent 8b0cc87 commit 57f020e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/sagemaker/serializers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from __future__ import absolute_import
1515

1616
import abc
17+
from collections.abc import Iterable
1718
import csv
1819
import io
1920
import json
@@ -202,7 +203,7 @@ def serialize(self, data):
202203
203204
Args:
204205
data (object): Data to be serialized. The data can be a string,
205-
list of JSON serializable objects, or a file-like object.
206+
iterable of JSON serializable objects, or a file-like object.
206207
207208
Returns:
208209
str: The data serialized as a string containing newline-separated
@@ -211,7 +212,7 @@ def serialize(self, data):
211212
if isinstance(data, str):
212213
return data
213214

214-
if isinstance(data, list):
215+
if isinstance(data, Iterable):
215216
return "\n".join(json.dumps(element) for element in data)
216217

217218
if hasattr(data, "read"):

0 commit comments

Comments
 (0)