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(name=None, dummy_for=None, mode=None, add_nonce=False, bitlength=None, _keep=None, print_json=None, authorization_file=None, dry_run=None, session=None, _return_job=False, **kwargs)¶
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 Authorization and 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