Skip to content

feat(langchain): Support BaseCallbackManager #4486

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

Draft
wants to merge 1 commit into
base: szokeasaurusrex/refactor-langchain-args
Choose a base branch
from

Conversation

szokeasaurusrex
Copy link
Member

While implementing #4479, I noticed that our Langchain integration lacks support for the local_callbacks having type BaseCallbackManager, which according to the type hint is possible.

This change adds support for this case.


Thank you for contributing to sentry-python! Please add tests to validate your changes, and lint your code using tox -e linters.

Running the test suite on your PR might require maintainer approval.

While implementing #4479, I noticed that our Langchain integration lacks support for the `local_callbacks` having type `BaseCallbackManager`, which according to the type hint is possible.

This change adds support for this case.
Copy link

codecov bot commented Jun 17, 2025

Codecov Report

Attention: Patch coverage is 70.58824% with 5 lines in your changes missing coverage. Please review.

Project coverage is 80.66%. Comparing base (901b579) to head (2468de2).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
sentry_sdk/integrations/langchain.py 70.58% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@                             Coverage Diff                             @@
##           szokeasaurusrex/refactor-langchain-args    #4486      +/-   ##
===========================================================================
+ Coverage                                    80.63%   80.66%   +0.03%     
===========================================================================
  Files                                          142      142              
  Lines                                        16037    16031       -6     
  Branches                                      2741     2743       +2     
===========================================================================
  Hits                                         12932    12932              
+ Misses                                        2239     2237       -2     
+ Partials                                       866      862       -4     
Files with missing lines Coverage Δ
sentry_sdk/integrations/langchain.py 71.48% <70.58%> (+1.05%) ⬆️

... and 4 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant