crandas.transactions¶
Transaction implementation.
- exception crandas.transactions.DirectlyAccessingDeferredObjectError¶
Bases:
Exception
Exception when accessing a deferred object outside a transaction
Operations performed inside a transaction return “deferred” objects (e.g., a
CDataFrame
that is an instance ofcrandas.command.Deferred
). Such deferred objects can be used inside the transaction but not outside it. When the transaction has completed, the resulting object is stored as the .result field of the deferred object. Outside of the object, this result field should be used. If the deferred object is used instead, this exception is raised.
- class crandas.transactions.Transaction(*, session=None, dummy_for=False, name=None, add_nonce=False, _keep=None, **execute_args)¶
Bases:
object
Transaction context manager
When used as a context manager (i.e., in a
with Transaction():
block), causes all commands in the context to be executed at the server as a single init. See transactions.
- crandas.transactions.show_transaction_graph(t, outfile)¶
Generates a transaction graph
- Parameters:
t (Transaction) – the Transaction to be graphed
outfile (str) – name of the output file