def _map_event_to_otel_span(row: pd.Series) -> Optional[OtelSpan]:
    """Convert an Event ORM table row to an OtelSpan format.

    Args:
        row: A pandas Series containing the Event ORM table row data

    Returns:
        An OtelSpan object if conversion is successful, None otherwise
    """
    try:
        # Parse record data
        record_data = _parse_json_fields(row.get("record", {}))
        span_record: SpanRecord = {
            "name": str(record_data.get("name", "")),
            "parent_span_id": str(record_data.get("parent_span_id", "")),
            "status": str(record_data.get("status", "")),
        }

        # Parse trace data
        trace_data = _parse_json_fields(row.get("trace", {}))
        span_trace: SpanTrace = {
            "trace_id": str(trace_data.get("trace_id", "")),
            "parent_id": str(trace_data.get("parent_id", "")),
            "span_id": str(trace_data.get("span_id", "")),
        }

        # Process record attributes
        record_attributes = _parse_json_fields(row.get("record_attributes", {}))
        serializable_attributes = {
            k: _make_serializable(v) for k, v in record_attributes.items()
        }

        # Create span with converted timestamps
        span: OtelSpan = {
            "event_id": str(row.get("event_id", "")),
            "record": span_record,
            "record_attributes": serializable_attributes,
            "start_timestamp": _convert_timestamp(row.get("start_timestamp")),
            "timestamp": _convert_timestamp(row.get("timestamp")),
            "trace": span_trace,
        }

        return span
    except Exception as e:
        st.warning(f"Error processing span: {e}")
        return None
Convert an Event ORM table row to an OtelSpan format.

    Args:
        row: A pandas Series containing the Event ORM table row data

    Returns:
        An OtelSpan object if conversion is successful, None otherwise
    
src/dashboard/trulens/dashboard/utils/dashboard_utils.py