|
19 | 19 | import time |
20 | 20 | import uuid |
21 | 21 | from datetime import datetime |
22 | | -from typing import Any, Awaitable, Callable, Dict, List, Optional, Sequence, Text, Union |
| 22 | +from typing import Any, Awaitable, Callable, Dict, List, Optional, Sequence, Text, Tuple, Union |
23 | 23 | from urllib.parse import urlencode |
24 | 24 | from warnings import warn |
25 | 25 |
|
@@ -154,7 +154,7 @@ def __init__( |
154 | 154 |
|
155 | 155 | useragent = f'dapr-sdk-python/{__version__}' |
156 | 156 | if not max_grpc_message_length: |
157 | | - options = [ |
| 157 | + options: List[Tuple[str, Any]] = [ |
158 | 158 | ('grpc.primary_user_agent', useragent), |
159 | 159 | ] |
160 | 160 | else: |
@@ -205,7 +205,7 @@ def __init__( |
205 | 205 |
|
206 | 206 | @staticmethod |
207 | 207 | def get_credentials(): |
208 | | - return grpc.ssl_channel_credentials() |
| 208 | + return grpc.ssl_channel_credentials() # type: ignore[attr-defined] |
209 | 209 |
|
210 | 210 | async def close(self): |
211 | 211 | """Closes Dapr runtime gRPC channel.""" |
@@ -604,7 +604,7 @@ async def subscribe_with_handler( |
604 | 604 | self, |
605 | 605 | pubsub_name: str, |
606 | 606 | topic: str, |
607 | | - handler_fn: Callable[..., TopicEventResponse], |
| 607 | + handler_fn: Callable[..., Awaitable[TopicEventResponse]], |
608 | 608 | metadata: Optional[dict] = None, |
609 | 609 | dead_letter_topic: Optional[str] = None, |
610 | 610 | ) -> Callable[[], Awaitable[None]]: |
@@ -1020,7 +1020,7 @@ async def execute_state_transaction( |
1020 | 1020 | operationType=o.operation_type.value, |
1021 | 1021 | request=common_v1.StateItem( |
1022 | 1022 | key=o.key, |
1023 | | - value=to_bytes(o.data), |
| 1023 | + value=to_bytes(o.data) if o.data is not None else to_bytes(''), |
1024 | 1024 | etag=common_v1.Etag(value=o.etag) if o.etag is not None else None, |
1025 | 1025 | ), |
1026 | 1026 | ) |
@@ -1360,7 +1360,7 @@ async def try_lock( |
1360 | 1360 | response = await call |
1361 | 1361 | return TryLockResponse( |
1362 | 1362 | success=response.success, |
1363 | | - client=self, |
| 1363 | + client=self, # type: ignore[arg-type] |
1364 | 1364 | store_name=store_name, |
1365 | 1365 | resource_id=resource_id, |
1366 | 1366 | lock_owner=lock_owner, |
@@ -1697,7 +1697,7 @@ async def raise_workflow_event( |
1697 | 1697 | else: |
1698 | 1698 | encoded_data = bytes([]) |
1699 | 1699 | # Actual workflow raise event invocation |
1700 | | - req = api_v1.raise_workflow_event( |
| 1700 | + req = api_v1.RaiseEventWorkflowRequest( |
1701 | 1701 | instance_id=instance_id, |
1702 | 1702 | workflow_component=workflow_component, |
1703 | 1703 | event_name=event_name, |
|
0 commit comments