Skip to content

Commit 1be4150

Browse files
author
Andrei Bratu
committed
PR #30
1 parent a3e4783 commit 1be4150

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/humanloop/eval_utils/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def upload_callback(log: dict):
467467
)
468468
start_time = datetime.now()
469469
try:
470-
if datapoint_dict.get("messages"):
470+
if "messages" in datapoint_dict and datapoint_dict["messages"] is not None:
471471
# function_ is decorated by Humanloop, the OTel Exporter will
472472
# handle the logging, which will call the upload_callback
473473
# function above when it's done

src/humanloop/otel/exporter.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,8 @@ def is_evaluated_file(
8484
evaluation_context = None
8585
for span in spans:
8686
if is_humanloop_span(span):
87-
# The thread doing the logging is different than the
88-
# thread spawned by eval_utils.run.run_eval. Need
89-
# to pass the EvaluationContext to the thread doing
90-
# the logging
87+
# We pass the EvaluationContext from the eval_run utility thread to
88+
# the export thread so the .log action works as expected
9189
self._upload_queue.put(
9290
(
9391
span,

0 commit comments

Comments
 (0)