Skip to content

Commit

Permalink
Support decimals in crash reporting (#1473)
Browse files Browse the repository at this point in the history
  • Loading branch information
slundqui committed May 17, 2024
1 parent f892af9 commit 096cb32
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/agent0/hyperlogs/json_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
from dataclasses import asdict, is_dataclass
from datetime import datetime
from decimal import Decimal
from enum import Enum
from traceback import format_tb
from types import TracebackType
Expand Down Expand Up @@ -48,6 +49,8 @@ def default(self, o: Any) -> Any:
return o.tolist()
if isinstance(o, FixedPoint):
return str(o)
if isinstance(o, Decimal):
return str(o)
if isinstance(o, Generator):
return "NumpyGenerator"
if isinstance(o, datetime):
Expand Down

0 comments on commit 096cb32

Please sign in to comment.