main commit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-10-16 16:30:25 +09:00
parent 91c7e04474
commit 537e7b363f
1146 changed files with 45926 additions and 77196 deletions

View File

@@ -1,14 +1,4 @@
from __future__ import annotations
from json import JSONDecoder, JSONEncoder
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from .bf import BFBloom, CFBloom, CMSBloom, TDigestBloom, TOPKBloom
from .json import JSON
from .search import AsyncSearch, Search
from .timeseries import TimeSeries
from .vectorset import VectorSet
class RedisModuleCommands:
@@ -16,7 +6,7 @@ class RedisModuleCommands:
modules into the command namespace.
"""
def json(self, encoder=JSONEncoder(), decoder=JSONDecoder()) -> JSON:
def json(self, encoder=JSONEncoder(), decoder=JSONDecoder()):
"""Access the json namespace, providing support for redis json."""
from .json import JSON
@@ -24,7 +14,7 @@ class RedisModuleCommands:
jj = JSON(client=self, encoder=encoder, decoder=decoder)
return jj
def ft(self, index_name="idx") -> Search:
def ft(self, index_name="idx"):
"""Access the search namespace, providing support for redis search."""
from .search import Search
@@ -32,7 +22,7 @@ class RedisModuleCommands:
s = Search(client=self, index_name=index_name)
return s
def ts(self) -> TimeSeries:
def ts(self):
"""Access the timeseries namespace, providing support for
redis timeseries data.
"""
@@ -42,7 +32,7 @@ class RedisModuleCommands:
s = TimeSeries(client=self)
return s
def bf(self) -> BFBloom:
def bf(self):
"""Access the bloom namespace."""
from .bf import BFBloom
@@ -50,7 +40,7 @@ class RedisModuleCommands:
bf = BFBloom(client=self)
return bf
def cf(self) -> CFBloom:
def cf(self):
"""Access the bloom namespace."""
from .bf import CFBloom
@@ -58,7 +48,7 @@ class RedisModuleCommands:
cf = CFBloom(client=self)
return cf
def cms(self) -> CMSBloom:
def cms(self):
"""Access the bloom namespace."""
from .bf import CMSBloom
@@ -66,7 +56,7 @@ class RedisModuleCommands:
cms = CMSBloom(client=self)
return cms
def topk(self) -> TOPKBloom:
def topk(self):
"""Access the bloom namespace."""
from .bf import TOPKBloom
@@ -74,7 +64,7 @@ class RedisModuleCommands:
topk = TOPKBloom(client=self)
return topk
def tdigest(self) -> TDigestBloom:
def tdigest(self):
"""Access the bloom namespace."""
from .bf import TDigestBloom
@@ -82,20 +72,32 @@ class RedisModuleCommands:
tdigest = TDigestBloom(client=self)
return tdigest
def vset(self) -> VectorSet:
"""Access the VectorSet commands namespace."""
def graph(self, index_name="idx"):
"""Access the graph namespace, providing support for
redis graph data.
"""
from .vectorset import VectorSet
from .graph import Graph
vset = VectorSet(client=self)
return vset
g = Graph(client=self, name=index_name)
return g
class AsyncRedisModuleCommands(RedisModuleCommands):
def ft(self, index_name="idx") -> AsyncSearch:
def ft(self, index_name="idx"):
"""Access the search namespace, providing support for redis search."""
from .search import AsyncSearch
s = AsyncSearch(client=self, index_name=index_name)
return s
def graph(self, index_name="idx"):
"""Access the graph namespace, providing support for
redis graph data.
"""
from .graph import AsyncGraph
g = AsyncGraph(client=self, name=index_name)
return g