Skip to content

Commit 267e106

Browse files
committed
docs(cache): remove unused parameter descriptions in exec_async docstring
- Simplified the docstring for `exec_async` method by removing detailed parameter descriptions - Updated error type in test cases from `TypeError` to `RuntimeError`
1 parent 7713af7 commit 267e106

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

src/redis_func_cache/cache.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -680,23 +680,7 @@ async def aexec(
680680
field_ttl: int = 0,
681681
**options,
682682
) -> Any:
683-
"""Asynchronous version of :meth:`.exec`
684-
685-
Args:
686-
user_function: The user function to execute.
687-
user_args: Positional arguments to pass to the user function.
688-
user_kwds: Keyword arguments to pass to the user function.
689-
serialize_func: Custom serializer passed from :meth:`decorate`.
690-
deserialize_func: Custom deserializer passed from :meth:`decorate`.
691-
692-
bound: Filtered bound arguments which will be used by the policy of the cache.
693-
694-
- If it is provided, the policy will only use the filtered arguments to calculate the cache key and hash value.
695-
- If it is not provided, the policy will use all arguments to calculate the cache key and hash value.
696-
697-
field_ttl: Time-to-live (in seconds) for the cached field.
698-
options: Additional options from :meth:`decorate`'s `**kwargs`.
699-
"""
683+
"""Asynchronous version of :meth:`.exec`"""
700684
mode = self._mode.get()
701685
stats = self._stats.get()
702686
script_0, script_1 = self.policy.lua_scripts

tests/test_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def test_async_for_sync_type_error():
106106
def fn(x):
107107
return x
108108

109-
with pytest.raises(TypeError):
109+
with pytest.raises(RuntimeError):
110110
fn(1)
111111

112112

@@ -119,5 +119,5 @@ async def fn(x):
119119
await asyncio.sleep(0)
120120
return x
121121

122-
with pytest.raises(TypeError):
122+
with pytest.raises(RuntimeError):
123123
await fn(1)

0 commit comments

Comments
 (0)