-
Notifications
You must be signed in to change notification settings - Fork 552
ref(langchain): Greatly simplify _wrap_configure
#4479
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
Open
szokeasaurusrex
wants to merge
1
commit into
master
Choose a base branch
from
szokeasaurusrex/refactor-langchain-args
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #4479 +/- ##
==========================================
- Coverage 80.64% 80.63% -0.01%
==========================================
Files 142 142
Lines 16033 16037 +4
Branches 2747 2741 -6
==========================================
+ Hits 12930 12932 +2
- Misses 2236 2239 +3
+ Partials 867 866 -1
|
f2bd2a6
to
9880666
Compare
e4dadc3
to
8adbbe7
Compare
Resolving #4443 requires some changes to this method, but the current `args`/`kwargs` business makes the method difficult to reason through. This PR simplifies the logic by listing out the parameters we need to access, so we don't need to access them through `args` and `kwargs`. We also cut down on the amount of branching and the amount of variables (`new_callbacks` vs `existing_callbacks`). Behavior does not change in this PR; we will introduce behavior changes in a subsequent PR
8adbbe7
to
901b579
Compare
szokeasaurusrex
added a commit
that referenced
this pull request
Jun 17, 2025
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.
sentrivana
approved these changes
Jun 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Soo much better! 🥔
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolving #4443 requires some changes to this method, but the current
args
/kwargs
business makes the method difficult to reason through.This PR simplifies the logic by listing out the parameters we need to access, so we don't need to access them through
args
andkwargs
.We also cut down on the amount of branching and the amount of variables (
new_callbacks
vsexisting_callbacks
).Behavior does not change in this PR; we fix the #4443 bug in #4485, which is based on this PR
Thank you for contributing to
sentry-python
! Please add tests to validate your changes, and lint your code usingtox -e linters
.Running the test suite on your PR might require maintainer approval.