Compare commits

...
Author SHA1 Message Date
Blackoutta 9c6ae362b3 fix: address arize phoenix trace review feedback 2026-04-21 16:53:33 +08:00
xuwei95andBlackoutta 2126a5a11b feat: try to see the hierarchy in phonenix trace rather than all single events
try to see the hierarchy in phonenix trace rather than all single events
2026-04-21 16:41:21 +08:00
2 changed files with 2024 additions and 386 deletions
@@ -396,3 +396,26 @@ def test_api_check_success(trace_instance):
def test_ensure_root_span_basic(trace_instance):
trace_instance.ensure_root_span("tid")
assert "tid" in trace_instance.dify_trace_ids
def test_find_logical_parent_span_uses_matching_node_context_keys(trace_instance):
parent_span = MagicMock()
child_execution = MagicMock()
child_execution.id = "exec-child"
child_execution.node_id = "child-node"
child_execution.index = 3
logical_parent = trace_instance._find_logical_parent_span(
child_execution,
node_spans={"parent-node": parent_span},
execution_context={
"parent-node": {
"index": 1,
"node_type": "tool",
"status": "succeeded",
"created_at": _dt(),
}
},
)
assert logical_parent is parent_span