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

Function abort_transaction

tests/test-key-value-store.py:59–63  ·  view source on GitHub ↗
(name, txn_id)

Source from the content-addressed store, hash-verified

57 raise Exception(f"Failed to commit transaction: {response.text}")
58
59def abort_transaction(name, txn_id):
60 url = f"{client.base_url}/collections/{name}/transactions/{txn_id}/abort"
61 response = requests.post(url, headers=client._get_headers(), verify=client.verify_ssl)
62 if response.status_code not in [200, 204]:
63 raise Exception(f"Failed to abort transaction: {response.text}")
64
65def upsert(name, txn_id, key: str, value: str):
66 url = f"{client.base_url}/collections/{name}/transactions/{txn_id}/upsert"

Callers 2

run_in_txnFunction · 0.70
test_transaction_abortFunction · 0.70

Calls 1

_get_headersMethod · 0.45

Tested by

no test coverage detected