Skip to content

Commit

Permalink
code style + linting
Browse files Browse the repository at this point in the history
  • Loading branch information
kalaspuff committed Feb 5, 2024
1 parent e026011 commit 52ec59e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from tomodachi import Options
from tomodachi.envelope import JsonBase
from tomodachi.opentelemetry import TomodachiInstrumentor
from tomodachi.transport.aws_sns_sqs import MessageAttributesType, aws_sns_sqs, aws_sns_sqs_publish
from tomodachi.transport.aws_sns_sqs import MessageAttributesType, aws_sns_sqs

TomodachiInstrumentor().instrument(tracer_provider=TracerProvider())

Expand Down
1 change: 0 additions & 1 deletion tests/test_message_attributes_parsing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import decimal
from typing import Optional, cast

from tomodachi.transport.aws_sns_sqs import AWSSNSSQSTransport

Expand Down
27 changes: 9 additions & 18 deletions tomodachi/transport/aws_sns_sqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,17 +237,14 @@ class QueueDoesNotExistError(AWSSNSSQSException):

class MessageEnvelopeProtocol(Protocol):
@classmethod
async def build_message(cls, service: Service, topic: str, data: Any, **kwargs: Any) -> str:
...
async def build_message(cls, service: Service, topic: str, data: Any, **kwargs: Any) -> str: ...

@classmethod
async def parse_message(cls, payload: str, **kwargs: Any) -> Tuple[Any, str, Union[str, int, float]]:
...
async def parse_message(cls, payload: str, **kwargs: Any) -> Tuple[Any, str, Union[str, int, float]]: ...


class MessageBodyFormatterProtocol(Protocol):
async def __call__(self, context: MessageBodyFormatterContext, **kwargs: Any) -> str:
...
async def __call__(self, context: MessageBodyFormatterContext, **kwargs: Any) -> str: ...


@dataclasses.dataclass(frozen=True)
Expand Down Expand Up @@ -336,8 +333,7 @@ async def publish(
group_id: Optional[str] = None,
deduplication_id: Optional[str] = None,
**kwargs: Any,
) -> str:
...
) -> str: ...

@overload
@classmethod
Expand All @@ -357,8 +353,7 @@ async def publish(
group_id: Optional[str] = None,
deduplication_id: Optional[str] = None,
**kwargs: Any,
) -> asyncio.Task[str]:
...
) -> asyncio.Task[str]: ...

@classmethod
async def publish(
Expand Down Expand Up @@ -462,8 +457,7 @@ async def send_message(
type[MessageBodyFormatterProtocol] | MessageBodyFormatterProtocol
] = MessageBodyFormatter,
**kwargs: Any,
) -> str:
...
) -> str: ...

@overload
@classmethod
Expand All @@ -485,8 +479,7 @@ async def send_message(
type[MessageBodyFormatterProtocol] | MessageBodyFormatterProtocol
] = MessageBodyFormatter,
**kwargs: Any,
) -> asyncio.Task[str]:
...
) -> asyncio.Task[str]: ...

@classmethod
async def send_message(
Expand Down Expand Up @@ -1165,13 +1158,11 @@ async def routine_func(*a: Any, **kw: Any) -> Any:

@overload
@staticmethod
async def create_client(name: Literal["sns"], context: Dict) -> SNSClient:
...
async def create_client(name: Literal["sns"], context: Dict) -> SNSClient: ...

@overload
@staticmethod
async def create_client(name: Literal["sqs"], context: Dict) -> SQSClient:
...
async def create_client(name: Literal["sqs"], context: Dict) -> SQSClient: ...

@staticmethod
async def create_client(name: str, context: Dict) -> aiobotocore.client.AioBaseClient:
Expand Down

0 comments on commit 52ec59e

Please sign in to comment.