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 6059827 commit 4645bd0Copy full SHA for 4645bd0
template/startup_scripts/0002_data.py
@@ -51,11 +51,14 @@ def __call__(self, obj):
51
class E2BJSONFormatter(JSONFormatter):
52
def __call__(self, obj):
53
if isinstance(obj, (list, dict)):
54
- return orjson.loads(
55
- orjson.dumps(
56
- obj, option=orjson.OPT_SERIALIZE_NUMPY | orjson.OPT_NON_STR_KEYS
57
- )
58
- ), {"expanded": True}
+ try:
+ return orjson.loads(
+ orjson.dumps(
+ obj, option=orjson.OPT_SERIALIZE_NUMPY | orjson.OPT_NON_STR_KEYS
+ )
59
+ ), {"expanded": True}
60
+ except TypeError:
61
+ pass
62
63
return super().__call__(obj)
64
0 commit comments