Repository navigation
Remove dead ParseResult.HTML field and redundant EmailParser json-path Text - #20992
Conversation
…h Text PR infiniflow#19467 unified the component to JSON-only output, leaving Markdown/Text as the internal normalization fallback and direct-call contract. HTML was never produced by any Go parser, so the ParseResult.HTML field and its normalization branches were dead code. - Drop ParseResult.HTML and the html branch in resolveParserNormalizationSource / normalizeParserJSON / parseResultText. - Stop duplicating the flattened email body into result.Text on the JSON output path; the searchable text already lives in the JSON items. The "text" output_format branch still populates result.Text. Add TDD guards: TestParseResult_Contract drops the html family, TestNormalizeParserJSON_EmptyPayloadYieldsEmpty pins empty payload -> empty slice, TestEmailParserJSONPathOmitsDuplicateText / TestEmailParserTextPathKeepsText pin the json/text Text contract.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
LGTM at 02b272e. I checked the parser producers and the normalization/file-content consumers. HTML parsing already returns JSON items; removing the unused HTML result field does not remove the HTML file parser. Email's JSON output remains the content source after dropping its duplicate Text field. With |
…pt typed JSON tests Rebasing the DocItem boundary-adapter branch onto the current upstream/main surfaced two classes of breakage that the original PR (base predating these upstream changes) did not have: - upstream infiniflow#20992 removed ParseResult.HTML as dead/redundant, so the HTML fallback in normalizeParserJSON (which referenced dispatched.HTML) no longer compiles. Drop that branch to match the post-infiniflow#20992 contract; HTML normalization is no longer carried on ParseResult. - upstream's newer tests (csv/email/office_table_render) index res.JSON as []map[string]any. With JSON now typed []DocItem they must project via DocItem.ToMap() (same boundary-adapter pattern used in the integration test fix). - email json-path must not duplicate the flattened body into result.Text (text lives in the JSON items), matching the upstream test TestEmailParserJSONPathOmitsDuplicateText; drop Text: text from the json return.
Summary
PR #19467 unified the ingestion component to JSON-only output, leaving
Markdown/Textas the internal normalization fallback and the direct-call contract.HTMLwas never produced by any Go parser, soParseResult.HTMLand its normalization branches were dead code.ParseResult.HTMLand the html branch inresolveParserNormalizationSource/normalizeParserJSON/parseResultText.result.Texton the JSON output path; the searchable text already lives in the JSON items. Thetextoutput_formatbranch still populatesresult.Text(it is the only path that reads it downstream viaparseResultText).Test plan
TestParseResult_Contractdrops the html family clause.TestNormalizeParserJSON_EmptyPayloadYieldsEmptypins empty payload -> empty slice (no html fall-through).TestEmailParserJSONPathOmitsDuplicateText/TestEmailParserTextPathKeepsTextpin the json/textTextcontract.bash build.sh --testgreen forinternal/parser/parser,internal/ingestion/component,internal/ingestion/component/chunker,internal/service/file.