Skip to content

Commit

Permalink
[Python] fix: handle vals that can't have truthiness checks (#921)
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw authored Aug 12, 2024
1 parent d722293 commit a73ca19
Show file tree
Hide file tree
Showing 3 changed files with 436 additions and 319 deletions.
9 changes: 6 additions & 3 deletions python/langsmith/run_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,12 @@ def _on_run_end(
error: Optional[BaseException] = None,
) -> None:
"""Handle the end of run."""
if outputs and outputs_processor is not None:
outputs = outputs_processor(outputs)
_container_end(container, outputs=outputs, error=error)
try:
if outputs_processor is not None:
outputs = outputs_processor(outputs)
_container_end(container, outputs=outputs, error=error)
except BaseException as e:
LOGGER.warning(f"Unable to process trace outputs: {repr(e)}")

if kwargs:
warnings.warn(
Expand Down
Loading

0 comments on commit a73ca19

Please sign in to comment.