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

Function abort_transaction

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

Source from the content-addressed store, hash-verified

94 raise Exception(f"Failed to commit transaction: {response.text}")
95
96def abort_transaction(name, txn_id):
97 url = f"{client.base_url}/collections/{name}/transactions/{txn_id}/abort"
98 response = requests.post(
99 url,
100 headers=client._get_headers(),
101 verify=client.verify_ssl,
102 )
103
104 if response.status_code not in [200, 204]:
105 raise Exception(f"Failed to abort transaction: {response.text}")
106
107def upsert(name, txn_id, key: str, value: str):
108 url = f"{client.base_url}/collections/{name}/transactions/{txn_id}/upsert"

Callers 1

mainFunction · 0.70

Calls 1

_get_headersMethod · 0.45

Tested by

no test coverage detected