fix: clear stale metadata extraction errors after successful retries - #12533
Open
CoralGarden52 wants to merge 1 commit into
Open
fix: clear stale metadata extraction errors after successful retries#12533CoralGarden52 wants to merge 1 commit into
CoralGarden52 wants to merge 1 commit into
Conversation
CoralGarden52
requested review from
julian-risch
and removed request for
a team
August 31, 2026 12:25
|
@CoralGarden52 is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
This was referenced Sep 2, 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.
Related Issues
Proposed Changes
The failure metadata cleanup in
LLMMetadataExtractorran inside the loop over parsed metadata keys. A retry that returned a valid empty JSON object therefore leftmetadata_extraction_errorandmetadata_extraction_responseon the successful document.Move that cleanup after metadata is applied so every successful parse, including
{}, clears stale failure state. The change includes synchronous and asynchronous regression tests for a failed extraction followed by an empty-JSON retry.How did you test it?
uvx hatch env run -e test -- pytest -q test/components/extractors/test_llm_metadata_extractor.py(29 passed, 2 skipped)uvx hatch run fmt-check haystack/components/extractors/llm_metadata_extractor.py test/components/extractors/test_llm_metadata_extractor.pyuvx hatch -e test run types haystack/components/extractors/llm_metadata_extractor.pyuvx hatch run reno lint .uvx hatch run pre-commit run --files haystack/components/extractors/llm_metadata_extractor.py test/components/extractors/test_llm_metadata_extractor.py releasenotes/notes/clear-stale-llm-metadata-retry-errors-778a9d314d7459d1.yamlNotes for the reviewer
{}is valid whenexpected_keysis not configured and represents a successful extraction with no metadata to add. Public behavior and documentation remain unchanged, so no docstring update is needed.This PR was fully generated with an AI assistant. I have reviewed the changes and run the relevant tests.
Checklist