Skip to content

Commit

Permalink
PNLP-7915: typing
Browse files Browse the repository at this point in the history
  • Loading branch information
SyrexMinus committed Oct 27, 2023
1 parent 20eb541 commit de4ad8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/message/from_message.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# coding=utf-8
from typing import Iterable, Dict, Optional, Any, List, Union, Sequence
from typing import Iterable, Dict, Optional, Any, List, Union, Sequence, Tuple
import json
import uuid

Expand Down Expand Up @@ -57,7 +57,7 @@ class SmartAppFromMessage:
uuid: dict

def __init__(self, value: Dict[str, Any], topic_key: str = None, creation_time: Optional[int] = None,
kafka_key: Optional[str] = None, headers: Optional[Sequence[tuple[str, bytes]]] = None,
kafka_key: Optional[str] = None, headers: Optional[Sequence[Tuple[str, bytes]]] = None,
masking_fields: Optional[Union[Dict[str, int], List[str]]] = None, headers_required: bool = True,
validators: Iterable[MessageValidator] = ()):
self.logging_uuid = str(uuid.uuid4())
Expand Down
4 changes: 2 additions & 2 deletions core/mq/kafka/kafka_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

if TYPE_CHECKING:
from asyncio import AbstractEventLoop
from typing import Union, Optional, Tuple, Any, Dict, Sequence
from typing import Optional, Tuple, Any, Dict, Sequence


class KafkaPublisher(BaseKafkaPublisher):
Expand All @@ -35,7 +35,7 @@ def __init__(self, config: Dict[str, Any], loop: AbstractEventLoop):
loop.run_until_complete(self._producer.start())

async def send(self, value: bytes, key: Any = None, topic_key: Optional[str] = None,
headers: Optional[Sequence[tuple[str, bytes]]] = None) -> None:
headers: Optional[Sequence[Tuple[str, bytes]]] = None) -> None:
topic = self._config["topic"]
if topic_key is not None:
topic = topic[topic_key]
Expand Down

0 comments on commit de4ad8f

Please sign in to comment.