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

Function get_transaction_status

tests/utils.py:4–10  ·  view source on GitHub ↗

Get the status of a transaction

(client, coll_name, txn_id)

Source from the content-addressed store, hash-verified

2import time
3
4def get_transaction_status(client, coll_name, txn_id):
5 """Get the status of a transaction"""
6 host = client.host
7 url = f"{host}/vectordb/collections/{coll_name}/transactions/{txn_id}/status"
8 resp = requests.get(url, headers=client._get_headers(), verify=False)
9 result = resp.json()
10 return result['status']
11
12def poll_transaction_completion(client, collection_name, txn_id, target_status='complete',
13 max_attempts=10, sleep_interval=1):

Callers 1

Calls 2

getMethod · 0.45
_get_headersMethod · 0.45

Tested by

no test coverage detected