Skip to content

Commit 97ece0f

Browse files
committed
Refactoring of the return type hint for vsim command.
1 parent 2b3531f commit 97ece0f

File tree

1 file changed

+10
-22
lines changed

1 file changed

+10
-22
lines changed

redis/commands/vectorset/commands.py

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919
VGETATTR_CMD = "VGETATTR"
2020
VRANDMEMBER_CMD = "VRANDMEMBER"
2121

22+
# Return type for vsim command
23+
VSimResult = Optional[
24+
List[
25+
Union[
26+
List[EncodableT], Dict[EncodableT, Number], Dict[EncodableT, Dict[str, Any]]
27+
]
28+
]
29+
]
30+
2231

2332
class QuantizationOptions(Enum):
2433
"""Quantization options for the VADD command."""
@@ -132,28 +141,7 @@ def vsim(
132141
truth: Optional[bool] = False,
133142
no_thread: Optional[bool] = False,
134143
epsilon: Optional[Number] = None,
135-
) -> Union[
136-
Awaitable[
137-
Optional[
138-
List[
139-
Union[
140-
List[EncodableT],
141-
Dict[EncodableT, Number],
142-
Dict[EncodableT, Dict[str, Any]],
143-
]
144-
]
145-
]
146-
],
147-
Optional[
148-
List[
149-
Union[
150-
List[EncodableT],
151-
Dict[EncodableT, Number],
152-
Dict[EncodableT, Dict[str, Any]],
153-
]
154-
]
155-
],
156-
]:
144+
) -> Union[Awaitable[VSimResult], VSimResult]:
157145
"""
158146
Compare a vector or element ``input`` with the other vectors in a vector set ``key``.
159147

0 commit comments

Comments
 (0)