@@ -419,12 +419,14 @@ def from_proto(
419
419
class InitRequest (IToProto ):
420
420
topics_read_settings : List ["StreamReadMessage.InitRequest.TopicReadSettings" ]
421
421
consumer : str
422
+ auto_partitioning_support : bool
422
423
423
424
def to_proto (self ) -> ydb_topic_pb2 .StreamReadMessage .InitRequest :
424
425
res = ydb_topic_pb2 .StreamReadMessage .InitRequest ()
425
426
res .consumer = self .consumer
426
427
for settings in self .topics_read_settings :
427
428
res .topics_read_settings .append (settings .to_proto ())
429
+ res .auto_partitioning_support = self .auto_partitioning_support
428
430
return res
429
431
430
432
@dataclass
@@ -696,6 +698,20 @@ def to_proto(self) -> ydb_topic_pb2.StreamReadMessage.StopPartitionSessionRespon
696
698
partition_session_id = self .partition_session_id ,
697
699
)
698
700
701
+ @dataclass
702
+ class EndPartitionSession (IFromProto ):
703
+ partition_session_id : int
704
+ adjacent_partition_ids : List [int ]
705
+ child_partition_ids : List [int ]
706
+
707
+ @staticmethod
708
+ def from_proto (msg : ydb_topic_pb2 .StreamReadMessage .EndPartitionSession ):
709
+ return StreamReadMessage .EndPartitionSession (
710
+ partition_session_id = msg .partition_session_id ,
711
+ adjacent_partition_ids = list (msg .adjacent_partition_ids ),
712
+ child_partition_ids = list (msg .child_partition_ids ),
713
+ )
714
+
699
715
@dataclass
700
716
class FromClient (IToProto ):
701
717
client_message : "ReaderMessagesFromClientToServer"
@@ -775,6 +791,13 @@ def from_proto(
775
791
msg .partition_session_status_response
776
792
),
777
793
)
794
+ elif mess_type == "end_partition_session" :
795
+ return StreamReadMessage .FromServer (
796
+ server_status = server_status ,
797
+ server_message = StreamReadMessage .EndPartitionSession .from_proto (
798
+ msg .end_partition_session ,
799
+ )
800
+ )
778
801
else :
779
802
raise issues .UnexpectedGrpcMessage (
780
803
"Unexpected message while parse ReaderMessagesFromServerToClient: '%s'" % mess_type
@@ -799,6 +822,7 @@ def from_proto(
799
822
UpdateTokenResponse ,
800
823
StreamReadMessage .StartPartitionSessionRequest ,
801
824
StreamReadMessage .StopPartitionSessionRequest ,
825
+ StreamReadMessage .EndPartitionSession ,
802
826
]
803
827
804
828
0 commit comments