Skip to content

Commit 607d94b

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent c912d92 commit 607d94b

23 files changed

+1475
-1464
lines changed

src/vdf_io/import_vdf/astradb_import.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,15 @@ def flush_batch_to_db(collection, keys, vectors, metadata):
248248
for i in range(0, total_points, BATCH_SIZE)
249249
]
250250

251-
with concurrent.futures.ThreadPoolExecutor(
252-
max_workers=num_parallel_threads
253-
) as executor, tqdm(
254-
total=total_points,
255-
desc=f"Flushing to DB in batches of {BATCH_SIZE} in {num_parallel_threads} threads",
256-
) as pbar:
251+
with (
252+
concurrent.futures.ThreadPoolExecutor(
253+
max_workers=num_parallel_threads
254+
) as executor,
255+
tqdm(
256+
total=total_points,
257+
desc=f"Flushing to DB in batches of {BATCH_SIZE} in {num_parallel_threads} threads",
258+
) as pbar,
259+
):
257260
future_to_batch = {
258261
executor.submit(flush_batch_to_db, collection, *batch): batch
259262
for batch in batches

src/vdf_io/import_vdf/qdrant_import.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,15 @@ def get_nested_config(config, keys, default=None):
313313
total_points = len(points)
314314

315315
num_parallel_threads = self.args.get("parallel", 5) or 5
316-
with concurrent.futures.ThreadPoolExecutor(
317-
max_workers=num_parallel_threads
318-
) as executor, tqdm(
319-
total=total_points,
320-
desc=f"Uploading points in batches of {BATCH_SIZE} in {num_parallel_threads} threads",
321-
) as pbar:
316+
with (
317+
concurrent.futures.ThreadPoolExecutor(
318+
max_workers=num_parallel_threads
319+
) as executor,
320+
tqdm(
321+
total=total_points,
322+
desc=f"Uploading points in batches of {BATCH_SIZE} in {num_parallel_threads} threads",
323+
) as pbar,
324+
):
322325
# Create a future to batch mapping to update progress bar correctly after each batch completion
323326
future_to_batch = {
324327
executor.submit(

0 commit comments

Comments
 (0)