Skip to content

Fix: Unpack and store alignment parameters in Resolver#318

Open
sashimikun wants to merge 1 commit intogoogle:mainfrom
sashimikun:fix-resolver-params-unpacking-18246846129585881633
Open

Fix: Unpack and store alignment parameters in Resolver#318
sashimikun wants to merge 1 commit intogoogle:mainfrom
sashimikun:fix-resolver-params-unpacking-18246846129585881633

Conversation

@sashimikun
Copy link

@sashimikun sashimikun commented Jan 18, 2026

Address: #245

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.

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.
@google-cla
Copy link

google-cla bot commented Jan 18, 2026

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.

@github-actions
Copy link

No linked issues found. Please link an issue in your pull request description or title.

Per our Contributing Guidelines, all PRs must:

  • Reference an issue with one of:
    • Closing keywords: Fixes #123, Closes #123, Resolves #123 (auto-closes on merge in the same repository)
    • Reference keywords: Related to #123, Refs #123, Part of #123, See #123 (links without closing)
  • The linked issue should have 5+ 👍 reactions from unique users (excluding bots and the PR author)
  • Include discussion demonstrating the importance of the change

You can also use cross-repo references like owner/repo#123 or full URLs.

@github-actions github-actions bot added the size/S Pull request with 50-150 lines changed label Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Pull request with 50-150 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants