Skip to content

Commit

Permalink
fix: handle ndarray for json.dumps in encode_span_to_otlp (#4838)
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerHYang authored Oct 2, 2024
1 parent 30c675d commit ae864d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/phoenix/trace/otel.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
SpanStatusCode,
TraceID,
)
from phoenix.utilities.json import jsonify

DOCUMENT_METADATA = DocumentAttributes.DOCUMENT_METADATA
INPUT_MIME_TYPE = SpanAttributes.INPUT_MIME_TYPE
Expand Down Expand Up @@ -194,7 +195,7 @@ def encode_span_to_otlp(span: Span) -> otlp.Span:
elif isinstance(value, Mapping):
attributes.pop(key, None)
if key.endswith(JSON_STRING_ATTRIBUTES):
attributes[key] = json.dumps(value)
attributes[key] = json.dumps(jsonify(value))
else:
attributes.update(
flatten(
Expand Down

0 comments on commit ae864d9

Please sign in to comment.