Skip to content

Commit 2e7f698

Browse files
authored
Merge pull request #717 from victimsnino/patch-1 Fix invalid read_from usage
2 parents 887773c + 4f0d206 commit 2e7f698

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

ydb/_grpc/grpcwrapper/ydb_topic.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -479,18 +479,12 @@ class TopicReadSettings(IToProto):
479479
def to_proto(
480480
self,
481481
) -> ydb_topic_pb2.StreamReadMessage.InitRequest.TopicReadSettings:
482-
res = ydb_topic_pb2.StreamReadMessage.InitRequest.TopicReadSettings()
483-
res.path = self.path
484-
res.partition_ids.extend(self.partition_ids)
485-
max_lag = proto_duration_from_timedelta(self.max_lag)
486-
if max_lag is not None:
487-
res.max_lag = max_lag
488-
489-
read_from = proto_timestamp_from_datetime(self.read_from)
490-
if read_from is not None:
491-
res.read_from = read_from
492-
493-
return res
482+
return ydb_topic_pb2.StreamReadMessage.InitRequest.TopicReadSettings(
483+
path=self.path,
484+
partition_ids=self.partition_ids,
485+
max_lag=proto_duration_from_timedelta(self.max_lag),
486+
read_from=proto_timestamp_from_datetime(self.read_from),
487+
)
494488

495489
@dataclass
496490
class InitResponse(IFromProto):

0 commit comments

Comments
 (0)