Skip to content

Commit 4cd5d8e

Browse files
committed
fix: resolve mypy type errors in AsyncRealtimeClient
- Add class-level type annotation for serializer: Optional[Serializer] - Add type annotation for message_data: Union[str, bytes] - Fix type compatibility issues with websocket send method
1 parent b428c5a commit 4cd5d8e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/realtime/src/realtime/_async/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def wrapper(*args, **kwargs):
4242

4343

4444
class AsyncRealtimeClient:
45+
serializer: Optional[Serializer]
4546
def __init__(
4647
self,
4748
url: str,
@@ -375,6 +376,7 @@ async def send(self, message: Union[Message, Dict[str, Any]]) -> None:
375376
msg = Message(**message)
376377

377378
# Encode message based on serializer version
379+
message_data: Union[str, bytes]
378380
if self.vsn == VSN_2_0_0 and self.serializer:
379381
# Convert Message to dict for serializer
380382
msg_dict = {

0 commit comments

Comments
 (0)