@@ -6470,131 +6470,6 @@ def function_stats(self) -> Union[Awaitable[List], List]:
6470
6470
AsyncFunctionCommands = FunctionCommands
6471
6471
6472
6472
6473
- class GearsCommands :
6474
- def tfunction_load (
6475
- self , lib_code : str , replace : bool = False , config : Union [str , None ] = None
6476
- ) -> ResponseT :
6477
- """
6478
- Load a new library to RedisGears.
6479
-
6480
- ``lib_code`` - the library code.
6481
- ``config`` - a string representation of a JSON object
6482
- that will be provided to the library on load time,
6483
- for more information refer to
6484
- https://github.com/RedisGears/RedisGears/blob/master/docs/function_advance_topics.md#library-configuration
6485
- ``replace`` - an optional argument, instructs RedisGears to replace the
6486
- function if its already exists
6487
-
6488
- For more information see https://redis.io/commands/tfunction-load/
6489
- """
6490
- pieces = []
6491
- if replace :
6492
- pieces .append ("REPLACE" )
6493
- if config is not None :
6494
- pieces .extend (["CONFIG" , config ])
6495
- pieces .append (lib_code )
6496
- return self .execute_command ("TFUNCTION LOAD" , * pieces )
6497
-
6498
- def tfunction_delete (self , lib_name : str ) -> ResponseT :
6499
- """
6500
- Delete a library from RedisGears.
6501
-
6502
- ``lib_name`` the library name to delete.
6503
-
6504
- For more information see https://redis.io/commands/tfunction-delete/
6505
- """
6506
- return self .execute_command ("TFUNCTION DELETE" , lib_name )
6507
-
6508
- def tfunction_list (
6509
- self ,
6510
- with_code : bool = False ,
6511
- verbose : int = 0 ,
6512
- lib_name : Union [str , None ] = None ,
6513
- ) -> ResponseT :
6514
- """
6515
- List the functions with additional information about each function.
6516
-
6517
- ``with_code`` Show libraries code.
6518
- ``verbose`` output verbosity level, higher number will increase verbosity level
6519
- ``lib_name`` specifying a library name (can be used multiple times to show multiple libraries in a single command) # noqa
6520
-
6521
- For more information see https://redis.io/commands/tfunction-list/
6522
- """
6523
- pieces = []
6524
- if with_code :
6525
- pieces .append ("WITHCODE" )
6526
- if verbose >= 1 and verbose <= 3 :
6527
- pieces .append ("v" * verbose )
6528
- else :
6529
- raise DataError ("verbose can be 1, 2 or 3" )
6530
- if lib_name is not None :
6531
- pieces .append ("LIBRARY" )
6532
- pieces .append (lib_name )
6533
-
6534
- return self .execute_command ("TFUNCTION LIST" , * pieces )
6535
-
6536
- def _tfcall (
6537
- self ,
6538
- lib_name : str ,
6539
- func_name : str ,
6540
- keys : KeysT = None ,
6541
- _async : bool = False ,
6542
- * args : List ,
6543
- ) -> ResponseT :
6544
- pieces = [f"{ lib_name } .{ func_name } " ]
6545
- if keys is not None :
6546
- pieces .append (len (keys ))
6547
- pieces .extend (keys )
6548
- else :
6549
- pieces .append (0 )
6550
- if args is not None :
6551
- pieces .extend (args )
6552
- if _async :
6553
- return self .execute_command ("TFCALLASYNC" , * pieces )
6554
- return self .execute_command ("TFCALL" , * pieces )
6555
-
6556
- def tfcall (
6557
- self ,
6558
- lib_name : str ,
6559
- func_name : str ,
6560
- keys : KeysT = None ,
6561
- * args : List ,
6562
- ) -> ResponseT :
6563
- """
6564
- Invoke a function.
6565
-
6566
- ``lib_name`` - the library name contains the function.
6567
- ``func_name`` - the function name to run.
6568
- ``keys`` - the keys that will be touched by the function.
6569
- ``args`` - Additional argument to pass to the function.
6570
-
6571
- For more information see https://redis.io/commands/tfcall/
6572
- """
6573
- return self ._tfcall (lib_name , func_name , keys , False , * args )
6574
-
6575
- def tfcall_async (
6576
- self ,
6577
- lib_name : str ,
6578
- func_name : str ,
6579
- keys : KeysT = None ,
6580
- * args : List ,
6581
- ) -> ResponseT :
6582
- """
6583
- Invoke an async function (coroutine).
6584
-
6585
- ``lib_name`` - the library name contains the function.
6586
- ``func_name`` - the function name to run.
6587
- ``keys`` - the keys that will be touched by the function.
6588
- ``args`` - Additional argument to pass to the function.
6589
-
6590
- For more information see https://redis.io/commands/tfcall/
6591
- """
6592
- return self ._tfcall (lib_name , func_name , keys , True , * args )
6593
-
6594
-
6595
- AsyncGearsCommands = GearsCommands
6596
-
6597
-
6598
6473
class DataAccessCommands (
6599
6474
BasicKeyCommands ,
6600
6475
HyperlogCommands ,
@@ -6638,7 +6513,6 @@ class CoreCommands(
6638
6513
PubSubCommands ,
6639
6514
ScriptCommands ,
6640
6515
FunctionCommands ,
6641
- GearsCommands ,
6642
6516
):
6643
6517
"""
6644
6518
A class containing all of the implemented redis commands. This class is
@@ -6655,7 +6529,6 @@ class AsyncCoreCommands(
6655
6529
AsyncPubSubCommands ,
6656
6530
AsyncScriptCommands ,
6657
6531
AsyncFunctionCommands ,
6658
- AsyncGearsCommands ,
6659
6532
):
6660
6533
"""
6661
6534
A class containing all of the implemented redis commands. This class is
0 commit comments