@@ -404,10 +404,9 @@ def remove_aql_function(self, name, group=None):
404404 # Transactions #
405405 ################
406406
407- # TODO deal with optional attribute "params"
408407 def execute_transaction (self , action , read_collections = None ,
409- write_collections = None , wait_for_sync = False ,
410- lock_timeout = None ):
408+ write_collections = None , params = None ,
409+ wait_for_sync = False , lock_timeout = None ):
411410 """Execute the transaction and return the result.
412411
413412 Setting the ``lock_timeout`` to 0 will make ArangoDB not time out
@@ -419,6 +418,8 @@ def execute_transaction(self, action, read_collections=None,
419418 :type read_collections: str or list or None
420419 :param write_collections: the collections written to
421420 :type write_collections: str or list or None
421+ :param params: Parameters for the function in action
422+ :type params: list or dict or None
422423 :param wait_for_sync: wait for the transaction to sync to disk
423424 :type wait_for_sync: bool
424425 :param lock_timeout: timeout for waiting on collection locks
@@ -433,11 +434,13 @@ def execute_transaction(self, action, read_collections=None,
433434 data ["collections" ]["read" ] = read_collections
434435 if write_collections is not None :
435436 data ["collections" ]["write" ] = write_collections
436- params = {
437+ if params is not None :
438+ data ["params" ] = params
439+ http_params = {
437440 "waitForSync" : wait_for_sync ,
438441 "lockTimeout" : lock_timeout ,
439442 }
440- res = self ._api .post (path = path , data = data , params = params )
443+ res = self ._api .post (path = path , data = data , params = http_params )
441444 if res .status_code != 200 :
442445 raise TransactionExecuteError (res )
443446 return res .obj ["result" ]
0 commit comments