Skip to content

Commit

Permalink
Raise error on empty deltas for incremental indexing (#1375)
Browse files Browse the repository at this point in the history
* Raise error on empty deltas for incremental indexing

* Format
  • Loading branch information
AlonsoGuevara authored Nov 6, 2024
1 parent 1661672 commit 3d79de9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .semversioner/next-release/patch-20241106232311738461.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "patch",
"description": "Raise error on empty deltas for inc indexing"
}
5 changes: 5 additions & 0 deletions graphrag/index/run/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ async def run_pipeline_with_config(
if is_update_run and update_index_storage:
delta_dataset = await get_delta_docs(dataset, storage)

# Fail on empty delta dataset
if delta_dataset.new_inputs.empty:
error_msg = "Incremental Indexing Error: No new documents to process."
raise ValueError(error_msg)

delta_storage = update_index_storage.child("delta")

# Run the pipeline on the new documents
Expand Down

0 comments on commit 3d79de9

Please sign in to comment.