Skip to content

Commit 8d4b641

Browse files
committed
Force refresh of progress bar
Previously users reported it got stuck at 0% in jupyter notebooks
1 parent e91dc57 commit 8d4b641

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

graphdatascience/query_runner/arrow_graph_constructor.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import concurrent
24
import json
35
import math
@@ -108,6 +110,8 @@ def _send_df(self, df: DataFrame, entity_type: str, pbar: tqdm[NoReturn]) -> Non
108110
for partition in batches:
109111
writer.write_batch(partition)
110112
pbar.update(partition.num_rows)
113+
# Force a refresh to avoid the progress bar getting stuck at 0%
114+
pbar.refresh()
111115

112116
def _send_dfs(self, dfs: List[DataFrame], entity_type: str) -> None:
113117
desc = "Uploading Nodes" if entity_type == "node" else "Uploading Relationships"

graphdatascience/query_runner/neo4j_query_runner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ def _log(self, job_id: str, future: "Future[Any]", database: Optional[str] = Non
261261

262262
for pbar in pbars.values():
263263
pbar.update(100 - pbar.n)
264+
pbar.refresh()
264265

265266
def set_database(self, database: str) -> None:
266267
self._database = database

0 commit comments

Comments
 (0)