Skip to content

Commit 1899508

Browse files
committed
Fixed yet another Incompatible type issue
1 parent cd05f54 commit 1899508

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cogstack2.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,8 @@ def read_data_with_scan(self,
353353
temp_query = query.copy()
354354
query.clear()
355355
query["query"] = temp_query
356-
pr_bar: tqdm.tqdm = None
356+
pr_bar = tqdm.tqdm(desc="CogStack retrieved...",
357+
disable=not show_progress, colour='green')
357358

358359
scan_results = es_helpers.scan(self.elastic,
359360
index=index,
@@ -364,10 +365,8 @@ def read_data_with_scan(self,
364365
fields = include_fields,
365366
allow_no_indices=False,)
366367
all_mapped_results = []
367-
results = self.elastic.count(index=index, query=query["query"])
368-
pr_bar = tqdm.tqdm(scan_results, total=results["count"],
369-
desc="CogStack retrieved...",
370-
disable=not show_progress, colour='green')
368+
pr_bar.iterable = scan_results
369+
pr_bar.total = self.elastic.count(index=index, query=query["query"])["count"]
371370
all_mapped_results = self.__map_search_results(hits=pr_bar)
372371
except BaseException as err:
373372
if isinstance(err, KeyboardInterrupt):

0 commit comments

Comments
 (0)