mirror of https://github.com/langgenius/dify.git
fix: export telemetry routing constants for tests
Export CASE_ROUTING and CASE_TO_TRACE_TASK as module-level constants to fix import errors in enterprise telemetry tests. Tests were failing with: - ImportError: cannot import name 'CASE_ROUTING' from 'core.telemetry.gateway' - ImportError: cannot import name 'CASE_TO_TRACE_TASK' from 'core.telemetry.gateway' This fix allows tests to access the routing configuration without breaking the lazy-loading pattern used internally.
This commit is contained in:
parent
5c018184e7
commit
2f12505386
|
|
@ -60,7 +60,6 @@ def get_trace_task_to_case() -> dict:
|
|||
"""Return TraceTaskName → TelemetryCase (inverse of _get_case_to_trace_task)."""
|
||||
return {v: k for k, v in _get_case_to_trace_task().items()}
|
||||
|
||||
|
||||
def _get_case_routing() -> dict:
|
||||
global _case_routing
|
||||
if _case_routing is None:
|
||||
|
|
@ -87,6 +86,9 @@ def _get_case_routing() -> dict:
|
|||
}
|
||||
return _case_routing
|
||||
|
||||
# Public exports for tests and external consumers
|
||||
CASE_TO_TRACE_TASK = _get_case_to_trace_task()
|
||||
CASE_ROUTING = _get_case_routing()
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Helpers
|
||||
|
|
|
|||
Loading…
Reference in New Issue