Skip to content

Fix: Unpack and store alignment parameters in Resolver#318

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

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

Conversation

@sashimikun
Copy link
Copy Markdown

@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
Copy Markdown

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
Copy Markdown

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
@github-actions
Copy link
Copy Markdown

⚠️ Branch Update Required

Your branch is 1 commits behind main. Please update your branch to ensure CI checks run with the latest code:

git fetch origin main
git merge origin/main
git push

Note: Enable "Allow edits by maintainers" to allow automatic updates.

3 similar comments
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 5, 2026

⚠️ Branch Update Required

Your branch is 1 commits behind main. Please update your branch to ensure CI checks run with the latest code:

git fetch origin main
git merge origin/main
git push

Note: Enable "Allow edits by maintainers" to allow automatic updates.

@github-actions
Copy link
Copy Markdown

⚠️ Branch Update Required

Your branch is 1 commits behind main. Please update your branch to ensure CI checks run with the latest code:

git fetch origin main
git merge origin/main
git push

Note: Enable "Allow edits by maintainers" to allow automatic updates.

@github-actions
Copy link
Copy Markdown

⚠️ Branch Update Required

Your branch is 1 commits behind main. Please update your branch to ensure CI checks run with the latest code:

git fetch origin main
git merge origin/main
git push

Note: Enable "Allow edits by maintainers" to allow automatic updates.

@github-actions
Copy link
Copy Markdown

⚠️ Branch Update Required

Your branch is 7 commits behind main. Please update your branch to ensure CI checks run with the latest code:

git fetch origin main
git merge origin/main
git push

Note: Enable "Allow edits by maintainers" to allow automatic updates.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2026

⚠️ Branch Update Required

Your branch is 8 commits behind main. Please update your branch to ensure CI checks run with the latest code:

git fetch origin main
git merge origin/main
git push

Note: Enable "Allow edits by maintainers" to allow automatic updates.

@github-actions
Copy link
Copy Markdown

⚠️ Branch Update Required

Your branch is 11 commits behind main. Please update your branch to ensure CI checks run with the latest code:

git fetch origin main
git merge origin/main
git push

Note: Enable "Allow edits by maintainers" to allow automatic updates.

@github-actions
Copy link
Copy Markdown

⚠️ Branch Update Required

Your branch is 15 commits behind main. Please update your branch to ensure CI checks run with the latest code:

git fetch origin main
git merge origin/main
git push

Note: Enable "Allow edits by maintainers" to allow automatic updates.

@github-actions
Copy link
Copy Markdown

⚠️ Branch Update Required

Your branch is 22 commits behind main. Please update your branch to ensure CI checks run with the latest code:

git fetch origin main
git merge origin/main
git push

Note: Enable "Allow edits by maintainers" to allow automatic updates.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

⚠️ Branch Update Required

Your branch is 29 commits behind main. Please update your branch to ensure CI checks run with the latest code:

git fetch origin main
git merge origin/main
git push

Note: Enable "Allow edits by maintainers" to allow automatic updates.

1 similar comment
@github-actions
Copy link
Copy Markdown

⚠️ Branch Update Required

Your branch is 29 commits behind main. Please update your branch to ensure CI checks run with the latest code:

git fetch origin main
git merge origin/main
git push

Note: Enable "Allow edits by maintainers" to allow automatic updates.

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