Skip to content

Commit 7d282c4

Browse files
committed
format and fix types
1 parent bde9fff commit 7d282c4

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

Diff for: src/aleph/sdk/client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
MessageNotFoundError,
6262
MultipleMessagesError,
6363
)
64-
from .models import MessagesResponse, PostsResponse, Post
64+
from .models import MessagesResponse, Post, PostsResponse
6565
from .utils import check_unix_socket_valid, get_message_type_value
6666

6767
logger = logging.getLogger(__name__)
@@ -723,7 +723,7 @@ async def get_messages(
723723
pagination: int = 200,
724724
page: int = 1,
725725
message_type: Optional[MessageType] = None,
726-
message_types: Optional[List[MessageType]] = None,
726+
message_types: Optional[Iterable[MessageType]] = None,
727727
content_types: Optional[Iterable[str]] = None,
728728
content_keys: Optional[Iterable[str]] = None,
729729
refs: Optional[Iterable[str]] = None,

Diff for: src/aleph/sdk/models.py

+15-6
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):

Diff for: tests/unit/test_asynchronous_get.py

+1-1
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)