[PR #32059] fix: map all NodeType values to span kinds in Arize Phoenix tracing #33527

Open
opened 2026-02-21 20:53:26 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/32059

State: open
Merged: No


Summary

Fixes #31840

  • Replaced the stale "dataset_retrieval" branch (never a valid NodeType value) and the incomplete if/elif chain with a lookup-table helper _get_node_span_kind that maps every NodeType enum value to the correct OpenInferenceSpanKindValues.
  • Added the missing "knowledge-retrieval" -> RETRIEVER mapping (the actual enum value for knowledge retrieval nodes).
  • Added the missing "agent" -> AGENT mapping.
  • All remaining node types (start, end, if-else, code, loop, loop-start, loop-end, iteration, iteration-start, trigger-webhook, trigger-schedule, trigger-plugin, human-input, etc.) now correctly default to CHAIN.
  • Added comprehensive unit tests covering all NodeType enum members and the removal of the dead "dataset_retrieval" string.

Test plan

  • All 32 new unit tests pass (pytest api/tests/unit_tests/core/ops/test_arize_phoenix_trace.py)
  • Verify Arize Phoenix tracing works end-to-end with workflows containing the previously-unmapped node types (loop, iteration, agent, etc.)
**Original Pull Request:** https://github.com/langgenius/dify/pull/32059 **State:** open **Merged:** No --- ## Summary Fixes #31840 - Replaced the stale `"dataset_retrieval"` branch (never a valid `NodeType` value) and the incomplete `if/elif` chain with a lookup-table helper `_get_node_span_kind` that maps **every** `NodeType` enum value to the correct `OpenInferenceSpanKindValues`. - Added the missing `"knowledge-retrieval"` -> `RETRIEVER` mapping (the actual enum value for knowledge retrieval nodes). - Added the missing `"agent"` -> `AGENT` mapping. - All remaining node types (`start`, `end`, `if-else`, `code`, `loop`, `loop-start`, `loop-end`, `iteration`, `iteration-start`, `trigger-webhook`, `trigger-schedule`, `trigger-plugin`, `human-input`, etc.) now correctly default to `CHAIN`. - Added comprehensive unit tests covering all `NodeType` enum members and the removal of the dead `"dataset_retrieval"` string. ## Test plan - [x] All 32 new unit tests pass (`pytest api/tests/unit_tests/core/ops/test_arize_phoenix_trace.py`) - [ ] Verify Arize Phoenix tracing works end-to-end with workflows containing the previously-unmapped node types (loop, iteration, agent, etc.)
yindo added the pull-request label 2026-02-21 20:53:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33527