Upsert vectors to the collection using transaction
(collection, transaction, vectors)
| 74 | |
| 75 | |
| 76 | def upsert_in_transaction(collection, transaction, vectors): |
| 77 | """ |
| 78 | Upsert vectors to the collection using transaction |
| 79 | """ |
| 80 | # Convert to the format expected by the client |
| 81 | formatted_vectors = [ |
| 82 | { |
| 83 | "id": vector["id"], |
| 84 | "sparse_values": vector["values"], |
| 85 | "sparse_indices": vector["indices"], |
| 86 | } |
| 87 | for vector in vectors |
| 88 | ] |
| 89 | |
| 90 | transaction.batch_upsert_vectors(formatted_vectors) |
| 91 | |
| 92 | |
| 93 | def commit_transaction(transaction): |
nothing calls this directly
no outgoing calls
no test coverage detected