Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
dycw committed Sep 16, 2024
1 parent 50b2309 commit ce54200
Showing 1 changed file with 1 addition and 53 deletions.
54 changes: 1 addition & 53 deletions src/utilities/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from collections.abc import AsyncIterator, Iterator
from uuid import UUID

from redis.commands.timeseries import TimeSeries
from redis.typing import ResponseT


Expand Down Expand Up @@ -228,55 +227,4 @@ async def yield_client_async(
assert_never(never)


@contextmanager
def yield_time_series(
*,
host: str = _HOST,
port: int = _PORT,
db: int = 0,
password: str | None = None,
decode_responses: bool = False,
**kwargs: Any,
) -> Iterator[TimeSeries]:
"""Yield a synchronous time series client."""
with yield_client(
host=host,
port=port,
db=db,
password=password,
decode_responses=decode_responses,
**kwargs,
) as client:
yield client.ts()


@asynccontextmanager
async def yield_time_series_async(
*,
host: str = _HOST,
port: int = _PORT,
db: int = 0,
password: str | None = None,
decode_responses: bool = False,
**kwargs: Any,
) -> AsyncIterator[TimeSeries]:
"""Yield an asynchronous time series client."""
async with yield_client_async(
host=host,
port=port,
db=db,
password=password,
decode_responses=decode_responses,
**kwargs,
) as client:
yield client.ts()


__all__ = [
"RedisContainer",
"RedisKey",
"yield_client",
"yield_client_async",
"yield_time_series",
"yield_time_series_async",
]
__all__ = ["RedisContainer", "RedisKey", "yield_client", "yield_client_async"]

0 comments on commit ce54200

Please sign in to comment.