Skip to content

Commit

Permalink
chore (backend): improve readabiility of if-elif-else trace mapping i…
Browse files Browse the repository at this point in the history
…n evaluators_service
  • Loading branch information
aybruhm committed Nov 25, 2024
1 parent c641a9b commit f208e4a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions agenta-backend/agenta_backend/services/evaluators_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ async def map(
mapping_inputs = mapping_input.inputs
response_version = mapping_input.inputs.get("version")

trace = {}
if response_version == "3.0":
trace = mapping_inputs.get("tree", {})
elif response_version == "2.0":
trace = mapping_inputs.get("trace", {})

trace = process_distributed_trace_into_trace_tree(
trace=(
mapping_inputs["tree"]
if response_version == "3.0"
else mapping_inputs["trace"]
if response_version == "2.0"
else {}
),
trace=trace,
version=mapping_input.inputs.get("version"),
)
for to_key, from_key in mapping_input.mapping.items():
Expand Down

0 comments on commit f208e4a

Please sign in to comment.