Skip to content

Commit

Permalink
upsert_from_dataframe: Hide all progressbars if !show_progress (#310)
Browse files Browse the repository at this point in the history
## Problem

For GRPCIndex.upsert_from_dataframe() there is a second progressbar
used when use_async_requests is true (the default) - 'collecting async
responses'. However this progressbar is always shown, even if
show_progress is false.

## Solution

Make it respect the show_progress argument.


## Type of Change

- [x] Bug fix (non-breaking change which fixes an issue)
  • Loading branch information
daverigby committed Feb 14, 2024
1 parent 886f932 commit 14f6384
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pinecone/grpc/index_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ def upsert_from_dataframe(

if use_async_requests:
cast_results = cast(List[PineconeGrpcFuture], results)
results = [async_result.result() for async_result in tqdm(cast_results, desc="collecting async responses")]
results = [async_result.result() for async_result in
tqdm(cast_results, disable=not show_progress, desc="collecting async responses")]

upserted_count = 0
for res in results:
Expand Down

0 comments on commit 14f6384

Please sign in to comment.