Fix: Unpack and store alignment parameters in Resolver#318
Open
sashimikun wants to merge 1 commit intogoogle:mainfrom
Open
Fix: Unpack and store alignment parameters in Resolver#318sashimikun wants to merge 1 commit intogoogle:mainfrom
sashimikun wants to merge 1 commit intogoogle:mainfrom
Conversation
This commit modifies `langextract/resolver.py` to properly unpack and store alignment parameters (e.g., `fuzzy_alignment_threshold`, `enable_fuzzy_alignment`) when they are passed to the `Resolver` constructor via `resolver_params` (or kwargs). Previously, these parameters were causing a `TypeError` in `Resolver.__init__` because they were not popped from `kwargs` and `Resolver` did not expect them. Additionally, instance-level configuration was not persisted for use in `align` and `resolve` methods. Changes: - Update `Resolver.__init__` to consume alignment parameters from `kwargs` and store them as instance attributes. - Update `Resolver.align` and `Resolver.resolve` to accept `None` for these parameters and fallback to instance attributes or default constants. - Update `AbstractResolver` signatures to match. - Add `tests/resolver_params_test.py` to verify the fix.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
No linked issues found. Please link an issue in your pull request description or title. Per our Contributing Guidelines, all PRs must:
You can also use cross-repo references like |
Drtydzn956
approved these changes
Jan 18, 2026
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
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.
Address: #245
This commit modifies
langextract/resolver.pyto properly unpack and store alignment parameters (e.g.,fuzzy_alignment_threshold,enable_fuzzy_alignment) when they are passed to theResolverconstructor viaresolver_params(or kwargs).Previously, these parameters were causing a
TypeErrorinResolver.__init__because they were not popped fromkwargsandResolverdid not expect them. Additionally, instance-level configuration was not persisted for use inalignandresolvemethods.Changes:
Resolver.__init__to consume alignment parameters fromkwargsand store them as instance attributes.Resolver.alignandResolver.resolveto acceptNonefor these parameters and fallback to instance attributes or default constants.AbstractResolversignatures to match.tests/resolver_params_test.pyto verify the fix.