Hi Xander --
Here is the traceback:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[56], line 4
2 allspans=px.active_session().get_spans_dataframe()
3 #allspans=px.active_session().get_trace_dataset()
----> 4 dataset = TraceDataset.from_spans(allspans)
File ~\AppData\Local\anaconda3\envs\testdir\Lib\site-packages\phoenix\trace\trace_dataset.py:139, in TraceDataset.from_spans(cls, spans)
128 @classmethod
129 def from_spans(cls, spans: List[Span]) -> "TraceDataset":
130 """Creates a TraceDataset from a list of spans.
131
132 Args:
(...)
136 TraceDataset: A TraceDataset containing the spans.
137 """
138 return cls(
--> 139 pd.json_normalize(
140 (json.loads(span_to_json(span)) for span in spans), # type: ignore
141 max_level=1,
142 )
143 )
File ~\AppData\Local\anaconda3\envs\testdir\Lib\site-packages\pandas\io\json\_normalize.py:461, in _json_normalize(data, record_path, meta, meta_prefix, record_prefix, errors, sep, max_level)
458 return DataFrame(_simple_json_normalize(data, sep=sep))
460 if record_path is None:
--> 461 if any([isinstance(x, dict) for x in y.values()] for y in data):
462 # naive normalization, this is idempotent for flat records
463 # and potentially will inflate the data considerably for
464 # deeply nested structures:
465 # {VeryLong: { b: 1,c:2}} -> {VeryLong.b:1 ,VeryLong.c:@}
466 #
467 # TODO: handle record value which are lists, at least error
468 # reasonably
469 data = nested_to_record(data, sep=sep, max_level=max_level)
470 return DataFrame(data)
File ~\AppData\Local\anaconda3\envs\testdir\Lib\site-packages\pandas\io\json\_normalize.py:461, in <genexpr>(.0)
458 return DataFrame(_simple_json_normalize(data, sep=sep))
460 if record_path is None:
--> 461 if any([isinstance(x, dict) for x in y.values()] for y in data):
462 # naive normalization, this is idempotent for flat records
463 # and potentially will inflate the data considerably for
464 # deeply nested structures:
465 # {VeryLong: { b: 1,c:2}} -> {VeryLong.b:1 ,VeryLong.c:@}
466 #
467 # TODO: handle record value which are lists, at least error
468 # reasonably
469 data = nested_to_record(data, sep=sep, max_level=max_level)
470 return DataFrame(data)
AttributeError: 'str' object has no attribute 'values'
If I try px.active_session().get_trace_dataset(), I get
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[57], line 3
1 from phoenix.trace import TraceDataset
2 #allspans=px.active_session().get_spans_dataframe()
----> 3 allspans=px.active_session().get_trace_dataset()
4 dataset = TraceDataset.from_spans(allspans)
AttributeError: 'ThreadSession' object has no attribute 'get_trace_dataset'I'm not sure if I called that as you intended. Perhaps I'm missing an import?
Regards,
David