File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 1- from abc import ABC , abstractmethod
21from dataclasses import dataclass
32from datetime import datetime
43from uuid import UUID
Original file line number Diff line number Diff line change 55
66from tgdb .entities .relation .tuple import TID
77from tgdb .infrastructure .heap_tuple_encoding import HeapTupleEncoding
8- from tgdb .infrastructure .lazy_map import LazyMap
8+ from tgdb .infrastructure .lazy_map import ExternalValue , LazyMap , NoExternalValue
99from tgdb .infrastructure .telethon .client_pool import TelegramClientPool
1010
1111
1515def lazy_message_map (
1616 chat_id : int , pool : TelegramClientPool , computed_map_max_len : int
1717) -> LazyMessageMap :
18- async def tuple_message (tid : TID ) -> Message | None :
18+ async def tuple_message (tid : TID ) -> ExternalValue [ Message ] :
1919 search = HeapTupleEncoding .id_of_encoded_tuple_with_tid (tid )
2020
2121 messages = cast (TotalList , await pool ().get_messages (
2222 chat_id , search = search , limit = 1
2323 ))
2424
2525 if not messages :
26- return None
26+ return NoExternalValue ()
2727
28- return cast (Message | None , messages [0 ])
28+ return cast (Message , messages [0 ])
2929
3030 return LazyMap (computed_map_max_len , tuple_message )
You can’t perform that action at this time.
0 commit comments