Skip to content

fix(notion-extractor): guard against empty table row results#37836

Open
citizen204 wants to merge 1 commit into
langgenius:mainfrom
citizen204:fix-37817-notion-empty-table-rows
Open

fix(notion-extractor): guard against empty table row results#37836
citizen204 wants to merge 1 commit into
langgenius:mainfrom
citizen204:fix-37817-notion-empty-table-rows

Conversation

@citizen204

Copy link
Copy Markdown
Contributor

Summary

_read_table_rows() in notion_extractor.py assumed Notion always returns at least one result when fetching table block children. When the API returns an empty results array, indexing data['results'][0] raised IndexError.

This PR adds a guard that skips empty pages and continues pagination instead of crashing.

Fixes #37817

Changes

  • api/core/rag/extractor/notion_extractor.py: check data['results'] is non-empty before accessing the first row; if empty, advance the cursor or mark done and continue

When Notion returns an empty results array for a table block's
children, _read_table_rows() raised IndexError at data['results'][0].

Skip empty pages and continue pagination instead of crashing.

Fixes langgenius#37817
@citizen204 citizen204 requested a review from JohnJyong as a code owner June 23, 2026 19:27
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 50.91% 50.91% 0.00%
Strict coverage 50.42% 50.42% 0.00%
Typed symbols 30,199 30,199 0
Untyped symbols 29,399 29,399 0
Modules 2928 2928 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Notion extractor crashes on empty table row responses

1 participant