Fix JSONL loader handling of blank/invalid lines#2434
Open
natoverse wants to merge 3 commits into
Open
Conversation
Collaborator
Author
|
This replaces #2423 to include more handling of edge cases |
gaudyb
reviewed
Jul 11, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Improves robustness of the JSONL input reader so that a single blank or invalid line doesn’t cause the entire file to be skipped, aligning behavior with the reported issue (#2424).
Changes:
- Updated the JSONL reader to ignore blank/whitespace-only lines, skip malformed JSON rows, and skip non-object JSON values.
- Added a regression test and a JSONL fixture covering blank, invalid, and non-object rows.
- Added a semversioner patch note documenting the behavior change.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/graphrag-input/graphrag_input/jsonl.py | Makes JSONL parsing resilient by skipping blank/invalid/non-object rows and continuing through the file. |
| tests/unit/indexing/input/test_jsonl_loader.py | Adds regression coverage to ensure only valid object rows become documents. |
| tests/unit/indexing/input/data/jsonl-with-invalid-and-blank-lines/input.jsonl | Provides a fixture with blank, invalid JSON, and non-object rows interleaved with valid objects. |
| .semversioner/next-release/patch-20260710221345787890.json | Records the patch-level change in JSONL loader behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dworthen
approved these changes
Jul 14, 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.
Summary
Fixes #2424