MCPcopy Create free account
hub / github.com/cosdata/cosdata / process_vectors_batch

Function process_vectors_batch

tests/test-dataset.py:529–542  ·  view source on GitHub ↗

Process a batch of vectors and insert them into the database

(vectors, collection, batch_size)

Source from the content-addressed store, hash-verified

527
528
529def process_vectors_batch(vectors, collection, batch_size):
530 """Process a batch of vectors and insert them into the database"""
531 try:
532 # Ensure all IDs are strings
533 for vector in vectors:
534 vector["id"] = str(vector["id"])
535 txn_ = None
536 with collection.transaction() as txn:
537 txn.batch_upsert_vectors(vectors)
538 txn_ = txn
539 return txn_
540 except Exception as e:
541 print(f"Error processing batch: {e}")
542 return None
543
544
545def process_parquet_files(

Callers 1

process_parquet_filesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected