Skip to content

Commit

Permalink
fix: process_adb_cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
aMahanna committed Oct 11, 2023
1 parent e3d727e commit be9ca30
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions adbnx_adapter/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def __process_adb_cursor(
self,
progress_color: str,
cursor: Cursor,
callback: Callable[..., None],
process_adb_doc: Callable[..., None],
col: str,
col_size: int,
adb_map: Dict[str, NxId],
Expand All @@ -477,8 +477,8 @@ def __process_adb_cursor(
:type progress_color: str
:param cursor: The ArangoDB cursor for the current **col**.
:type cursor: arango.cursor.Cursor
:param callback: The callback function to process the cursor.
:type callback: Callable
:param process_adb_doc: The function to process the cursor data.
:type process_adb_doc: Callable
:param col: The ArangoDB collection for the current **cursor**.
:type col: str
:param col_size: The size of **col**.
Expand All @@ -495,10 +495,11 @@ def __process_adb_cursor(

with Live(Group(progress)):
while not cursor.empty():
for doc in cursor:
callback(doc, col, adb_map, nx_graph)
for doc in cursor.batch(): # type: ignore # false positive
process_adb_doc(doc, col, adb_map, nx_graph)
progress.advance(progress_task_id)

cursor.batch().clear() # type: ignore # false positive
if cursor.has_more():
cursor.fetch()

Expand Down

0 comments on commit be9ca30

Please sign in to comment.