Skip to content

Commit b22a75f

Browse files
committed
Parse numpy types
1 parent 077ecb1 commit b22a75f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

template/startup_scripts/0002_data.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,15 @@ def __call__(self, obj):
5454
# so it can't be used in type_printers or with top-level import
5555

5656
if isinstance(obj, dict):
57-
return obj, {"expanded": True}
57+
return orjson.loads(orjson.dumps(obj, option=orjson.OPT_SERIALIZE_NUMPY)), {
58+
"expanded": True
59+
}
60+
5861
if isinstance(obj, list):
59-
return obj, {"expanded": True}
62+
return orjson.loads(orjson.dumps(obj, option=orjson.OPT_SERIALIZE_NUMPY)), {
63+
"expanded": True
64+
}
65+
6066
return super().__call__(obj)
6167

6268

0 commit comments

Comments
 (0)