Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agentops/helpers/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def is_jsonable(x):
try:
json.dumps(x)
return True
except (TypeError, OverflowError):
except (TypeError, OverflowError, ValueError):
return False


Expand Down
5 changes: 1 addition & 4 deletions tests/unit/test_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,7 @@ def test_circular_reference(self):
a["b"] = b
b["a"] = a

# The current implementation doesn't handle ValueError from circular references
# So this will raise an exception instead of returning False
with pytest.raises(ValueError, match="Circular reference detected"):
is_jsonable(a)
assert is_jsonable(a) is False


# Define test cases for filter_unjsonable
Expand Down