We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f71b904 commit 02bb496Copy full SHA for 02bb496
langfuse/serializer.py
@@ -1,6 +1,7 @@
1
"""@private"""
2
3
import enum
4
+import math
5
from asyncio import Queue
6
from collections.abc import Sequence
7
from dataclasses import asdict, is_dataclass
@@ -54,6 +55,9 @@ def default(self, obj: Any):
54
55
if np is not None and isinstance(obj, np.generic):
56
return obj.item()
57
58
+ if isinstance(obj, float) and math.isnan(obj):
59
+ return None
60
+
61
if isinstance(obj, (Exception, KeyboardInterrupt)):
62
return f"{type(obj).__name__}: {str(obj)}"
63
0 commit comments