Make the default silent-chunk-drop on parse errors discoverable - #521
Open
ojassharma7 wants to merge 1 commit into
Open
Make the default silent-chunk-drop on parse errors discoverable#521ojassharma7 wants to merge 1 commit into
ojassharma7 wants to merge 1 commit into
Conversation
extract()'s default (suppress_parse_errors=True) drops a chunk with no exception on a parse or schema error, which is easy to miss: caller-side retry logic keyed on catching that exception never fires, because it never reaches the except block. Traced and reported by @reichaves on google#358 after independently hitting it in github.com/reichaves/langextract-fundos; not a bug, an existing knob that wasn't visible enough. No behavior change here, only visibility of the existing default: - resolver.py: the two warning-level log lines now say the data is gone and cannot be retried, and name the exact opt-out (resolver_params={'suppress_parse_errors': False}), instead of just "Skipping chunk: ...". - extraction.py: extract()'s docstring gets a Note callout right after the summary, ahead of the full Args list, instead of the behavior being reachable only via one line buried under resolver_params. Adds a regression test asserting the parse-error log message names both "no retry possible" and the opt-out, and strengthens the existing schema-error log test the same way.
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.
Description
extract()'s default (suppress_parse_errors=True) drops a chunk on a parse or schema error with no exception raised — the chunk's data is simply missing from the result. This is easy to miss: any caller-side retry logic written around catching a parse exception fromextract()never fires, because the exception never reaches it.Traced and reported by @reichaves on #358, after independently hitting it in
reichaves/langextract-fundos— not a bug, an existing knob (resolver_params={'suppress_parse_errors': False}) that just wasn't visible enough. No behavior change — only visibility of the existing default, per that comment: "Might be worth a doc callout or a debug-level log distinguishing 'chunk silently dropped, no retry possible' from other warnings."resolver.py: the two warning-level log lines now say the data is gone and cannot be retried, and name the exact opt-out, instead of just"Skipping chunk: ...".extraction.py:extract()'s docstring gets aNote:callout right after the summary — ahead of the fullArgslist — instead of the behavior being reachable only via one line buried underresolver_params.Related to #358
Type: Documentation (log-message wording + docstring only; no behavior change).
How Has This Been Tested?
New regression test asserting the parse-error log message names both "no retry possible" and the opt-out; the existing schema-error log test is strengthened the same way.
Differential-clean against the full suite:
765 passed(up by exactly this PR's one new test), same 42 pre-existing/environmental failures asmain(missing optionalopenaiextra + 3 plugin-packaging tests), none new.pyink+isort+pylint --rcfile=.pylintrc/--rcfile=tests/.pylintrc(CI's exact configs) all clean.Checklist:
Note:callout is the fix).pylintover the affected code.