Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(langchain): handle case when parent span wasn't traced #3656

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

rbasoalto
Copy link
Contributor

It's possible for the parent span to not have been traced (or have been GCd) so a KeyError would be raised when trying to fetch the span for the parent run_id. Now we defensively .get() the parent span instead of subscripting it.

It's possible for the parent span to not have been traced (or have been GCd) so a KeyError would be raised when trying to fetch the span for the parent run_id. Now we defensively `.get()` the parent span instead of subscripting it.
Copy link
Contributor

@sentrivana sentrivana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @rbasoalto!

@sentrivana sentrivana added the Trigger: tests using secrets PR code is safe; run CI label Oct 15, 2024
@sentrivana sentrivana enabled auto-merge (squash) October 15, 2024 11:25
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.31%. Comparing base (8a7e226) to head (a7bbaaf).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3656      +/-   ##
==========================================
- Coverage   84.32%   84.31%   -0.01%     
==========================================
  Files         133      133              
  Lines       14063    14063              
  Branches     2379     2379              
==========================================
- Hits        11858    11857       -1     
+ Misses       1472     1471       -1     
- Partials      733      735       +2     
Files with missing lines Coverage Δ
sentry_sdk/integrations/langchain.py 68.87% <100.00%> (ø)

... and 3 files with indirect coverage changes

@sentrivana sentrivana merged commit 846b8b2 into getsentry:master Oct 15, 2024
137 of 139 checks passed
@rbasoalto rbasoalto deleted the patch-1 branch October 15, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Trigger: tests using secrets PR code is safe; run CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants