Fix inserted-document count log to not depend on TTY-gated progress bar#30
Merged
Merged
Conversation
cli-progress's SingleBar.start() no-ops when stdout isn't a TTY, so progressBar.getTotal() stays at the library's default of 100 in any piped/redirected/CI run, regardless of how many documents were actually indexed. Report clean.length directly instead.
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.
cli-progress's SingleBar.start() no-ops when stdout isn't a TTY, so progressBar.getTotal() stays at the library's default of 100 in any piped/redirected/CI run, regardless of how many documents were actually indexed. Report clean.length directly instead.
Problem
Fixing broken / out of date sample apps
Solution
Describe the approach you took. Link to any relevant bugs, issues, docs, or other resources.
Type of Change
Test Plan
Describe specific steps for validating this change.
Note
Low Risk
Logging-only change with no effect on indexing, embeddings, or Pinecone upserts.
Overview
Fixes the post-index “Inserted N documents” log so N reflects the number of articles actually indexed instead of a misleading default from
cli-progress.When stdout is not a TTY (piped output, redirects, CI),
SingleBar.start()effectively does not initialize the bar total, soprogressBar.getTotal()could stay at the library default (e.g. 100) even when far more rows were upserted. The completion message now usesclean.length, matching the row count passed intoprogressBar.start()and the embed/upsert loop.Reviewed by Cursor Bugbot for commit 290dac9. Bugbot is set up for automated code reviews on this repo. Configure here.