Skip to content

Commit

Permalink
Catch exceptions (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos authored Jan 30, 2024
2 parents 2c7f166 + 82d3ae1 commit 0386d55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion python/langsmith/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ def upload_csv(

@staticmethod
def _run_transform(
run: Union[ls_schemas.Run, dict, ls_schemas.RunLikeDict]
run: Union[ls_schemas.Run, dict, ls_schemas.RunLikeDict],
) -> dict:
if hasattr(run, "dict") and callable(getattr(run, "dict")):
run_create = run.dict() # type: ignore
Expand Down Expand Up @@ -3193,6 +3193,10 @@ def _tracing_thread_handle_batch(
update = [it.item for it in batch if it.action == "update"]
try:
client.batch_ingest_runs(create=create, update=update, pre_sampled=True)
except Exception:
# exceptions are logged elsewhere, but we need to make sure the
# background thread continues to run
pass
finally:
for _ in batch:
tracing_queue.task_done()
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langsmith"
version = "0.0.84"
version = "0.0.85"
description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform."
authors = ["LangChain <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 0386d55

Please sign in to comment.