From b85c79b71d32865fd0ccead618ebe0fc6c92f4d8 Mon Sep 17 00:00:00 2001 From: Dave Rigby Date: Tue, 13 Feb 2024 14:53:34 +0000 Subject: [PATCH] upsert_from_dataframe: Hide all progressbars if !show_progress 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. Make it respect the show_progress argument. --- pinecone/grpc/index_grpc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pinecone/grpc/index_grpc.py b/pinecone/grpc/index_grpc.py index 3a3d1ed19..fedf8d3b4 100644 --- a/pinecone/grpc/index_grpc.py +++ b/pinecone/grpc/index_grpc.py @@ -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: