Skip to content

Commit ba18628

Browse files
committed
format and fix types
1 parent 93d1e2e commit ba18628

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

src/aleph/sdk/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
MessageNotFoundError,
6161
MultipleMessagesError,
6262
)
63-
from .models import MessagesResponse, PostsResponse, Post
63+
from .models import MessagesResponse, Post, PostsResponse
6464
from .utils import check_unix_socket_valid, get_message_type_value
6565

6666
logger = logging.getLogger(__name__)
@@ -722,7 +722,7 @@ async def get_messages(
722722
pagination: int = 200,
723723
page: int = 1,
724724
message_type: Optional[MessageType] = None,
725-
message_types: Optional[List[MessageType]] = None,
725+
message_types: Optional[Iterable[MessageType]] = None,
726726
content_types: Optional[Iterable[str]] = None,
727727
content_keys: Optional[Iterable[str]] = None,
728728
refs: Optional[Iterable[str]] = None,

src/aleph/sdk/models.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from typing import List, Optional, Any, Dict, Union
1+
from typing import Any, Dict, List, Optional, Union
22

3-
from aleph_message.models import AlephMessage, BaseMessage, ItemHash, ChainRef
3+
from aleph_message.models import AlephMessage, BaseMessage, ChainRef, ItemHash
44
from pydantic import BaseModel, Field
55

66

@@ -23,16 +23,25 @@ class Post(BaseMessage):
2323
A post is a type of message that can be updated. Over the get_posts API
2424
we get the latest version of a post.
2525
"""
26+
2627
hash: ItemHash = Field(description="Hash of the content (sha256 by default)")
27-
original_item_hash: ItemHash = Field(description="Hash of the original content (sha256 by default)")
28+
original_item_hash: ItemHash = Field(
29+
description="Hash of the original content (sha256 by default)"
30+
)
2831
original_signature: Optional[str] = Field(
2932
description="Cryptographic signature of the original message by the sender"
3033
)
31-
original_type: str = Field(description="The original, user-generated 'content-type' of the POST message")
32-
content: Dict[str, Any] = Field(description="The content.content of the POST message")
34+
original_type: str = Field(
35+
description="The original, user-generated 'content-type' of the POST message"
36+
)
37+
content: Dict[str, Any] = Field(
38+
description="The content.content of the POST message"
39+
)
3340
type: str = Field(description="The content.type of the POST message")
3441
address: str = Field(description="The address of the sender of the POST message")
35-
ref: Optional[Union[str, ChainRef]] = Field(description="Other message referenced by this one")
42+
ref: Optional[Union[str, ChainRef]] = Field(
43+
description="Other message referenced by this one"
44+
)
3645

3746

3847
class PostsResponse(PaginationResponse):

tests/unit/test_asynchronous_get.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from unittest.mock import AsyncMock
44

55
import pytest
6-
from aleph_message.models import MessagesResponse, MessageType
6+
from aleph_message.models import MessagesResponse
77

88
from aleph.sdk.client import AlephClient
99
from aleph.sdk.conf import settings

0 commit comments

Comments
 (0)