Skip to content

🐛 fix: Skip ES write and refresh when DataFrame is empty - #290

Merged
laurabegin merged 1 commit into
masterfrom
fix/indexer-empty-df
Apr 28, 2026
Merged

laurabegin merged 1 commit into
masterfrom
fix/indexer-empty-df

Conversation

@laurabegin

@laurabegin laurabegin commented Apr 28, 2026 •

Copy link
Copy Markdown
Member

Summary

  • After the CLIN-5853 indexer refactor, esClient.refreshIndex(currentIndex) fails when df.saveToEs writes nothing because the DataFrame is empty — the index never gets created via es.index.auto.create, so the refresh hits a missing index. Same risk applies to forceMerge, and to createIndex inside the disableReplicas branch.
  • Guards the whole post-setupIndex sequence (write, replica toggling, refresh, force merge) behind !df.isEmpty. Empty df is now a true no-op on ES, matching pre-refactor behavior.

Test plan

  • CI green
  • Manual run against ES with an empty DataFrame (both disableReplicas=true and disableReplicas=false) — confirm no index_not_found_exception
  • Manual run with a non-empty DataFrame — confirm write, refresh, and force merge still execute

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@laurabegin
laurabegin requested a review from evans-g-crsj April 28, 2026 16:03
@laurabegin
laurabegin requested a review from jecos April 28, 2026 17:11
@laurabegin
laurabegin merged commit a535f42 into master Apr 28, 2026
1 check passed
@laurabegin
laurabegin deleted the fix/indexer-empty-df branch April 28, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants