Skip to content

Make the default silent-chunk-drop on parse errors discoverable - #521

Open
ojassharma7 wants to merge 1 commit into
google:mainfrom
ojassharma7:feat/suppress-parse-errors-visibility
Open

Make the default silent-chunk-drop on parse errors discoverable#521
ojassharma7 wants to merge 1 commit into
google:mainfrom
ojassharma7:feat/suppress-parse-errors-visibility

Conversation

@ojassharma7

Copy link
Copy Markdown
Contributor

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 from extract() 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 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.

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.

$ python -m pytest tests/resolver_test.py

Differential-clean against the full suite: 765 passed (up by exactly this PR's one new test), same 42 pre-existing/environmental failures as main (missing optional openai extra + 3 plugin-packaging tests), none new. pyink + isort + pylint --rcfile=.pylintrc / --rcfile=tests/.pylintrc (CI's exact configs) all clean.

Checklist:

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Pull request with less than 50 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant