Skip to content

Commit 438bde3

Browse files
committed
linter
1 parent 69300d3 commit 438bde3

File tree

4 files changed

+28
-19
lines changed

4 files changed

+28
-19
lines changed

tests/topics/test_topic_reader.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,9 @@ def decode(b: bytes):
168168
@pytest.mark.asyncio
169169
class TestBugFixesAsync:
170170
@pytest.mark.skip("LOGBROKER-8319")
171-
async def test_issue_297_bad_handle_stop_partition(self, driver, topic_consumer, topic_with_two_partitions_path: str):
172-
171+
async def test_issue_297_bad_handle_stop_partition(
172+
self, driver, topic_consumer, topic_with_two_partitions_path: str
173+
):
173174
async def wait(fut):
174175
return await asyncio.wait_for(fut, timeout=10)
175176

@@ -187,10 +188,13 @@ async def wait(fut):
187188
await wait(reader0.receive_message())
188189

189190
# Start second reader for same topic, same consumer, partition 1
190-
reader1 = driver.topic_client.reader(ydb.TopicReaderSelector(
191-
path=topic,
192-
partitions=1,
193-
), consumer=topic_consumer)
191+
reader1 = driver.topic_client.reader(
192+
ydb.TopicReaderSelector(
193+
path=topic,
194+
partitions=1,
195+
),
196+
consumer=topic_consumer,
197+
)
194198

195199
await asyncio.sleep(0.1)
196200

ydb/_grpc/grpcwrapper/ydb_topic.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -601,15 +601,16 @@ class PartitionSessionStatusResponse(IFromProto):
601601
write_time_high_watermark: float
602602

603603
@staticmethod
604-
def from_proto(msg: ydb_topic_pb2.StreamReadMessage.PartitionSessionStatusResponse) -> "StreamReadMessage.PartitionSessionStatusResponse":
604+
def from_proto(
605+
msg: ydb_topic_pb2.StreamReadMessage.PartitionSessionStatusResponse,
606+
) -> "StreamReadMessage.PartitionSessionStatusResponse":
605607
return StreamReadMessage.PartitionSessionStatusResponse(
606608
partition_session_id=msg.partition_session_id,
607609
partition_offsets=OffsetsRange.from_proto(msg.partition_offsets),
608610
committed_offset=msg.committed_offset,
609611
write_time_high_watermark=msg.write_time_high_watermark,
610612
)
611613

612-
613614
@dataclass
614615
class StartPartitionSessionRequest(IFromProto):
615616
partition_session: "StreamReadMessage.PartitionSession"
@@ -650,14 +651,15 @@ class StopPartitionSessionRequest(IFromProto):
650651
committed_offset: int
651652

652653
@staticmethod
653-
def from_proto(msg: ydb_topic_pb2.StreamReadMessage.StopPartitionSessionRequest) -> StreamReadMessage.StopPartitionSessionRequest:
654+
def from_proto(
655+
msg: ydb_topic_pb2.StreamReadMessage.StopPartitionSessionRequest,
656+
) -> StreamReadMessage.StopPartitionSessionRequest:
654657
return StreamReadMessage.StopPartitionSessionRequest(
655658
partition_session_id=msg.partition_session_id,
656659
graceful=msg.graceful,
657660
committed_offset=msg.committed_offset,
658661
)
659662

660-
661663
@dataclass
662664
class StopPartitionSessionResponse:
663665
partition_session_id: int
@@ -723,7 +725,7 @@ def from_proto(
723725
server_status=server_status,
724726
server_message=StreamReadMessage.StopPartitionSessionRequest.from_proto(
725727
msg.stop_partition_session_request
726-
)
728+
),
727729
)
728730
elif mess_type == "update_token_response":
729731
return StreamReadMessage.FromServer(
@@ -735,7 +737,7 @@ def from_proto(
735737
server_status=server_status,
736738
server_message=StreamReadMessage.PartitionSessionStatusResponse.from_proto(
737739
msg.partition_session_status_response
738-
)
740+
),
739741
)
740742

741743

ydb/_topic_reader/topic_reader_asyncio.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
_module_logger = logging.getLogger(__name__)
3333

34+
3435
class TopicReaderError(YdbError):
3536
pass
3637

ydb/_topic_reader/topic_reader_asyncio_test.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,13 +1140,15 @@ def set_logged(*args, **kwargs):
11401140
stream_reader._logger.exception = mock.Mock(side_effect=set_logged)
11411141

11421142
# noinspection PyTypeChecker
1143-
stream.from_server.put_nowait(StreamReadMessage.FromServer(
1144-
server_status=ServerStatus(
1145-
status=issues.StatusCode.SUCCESS,
1146-
issues=[],
1147-
),
1148-
server_message=TestMessage(),
1149-
))
1143+
stream.from_server.put_nowait(
1144+
StreamReadMessage.FromServer(
1145+
server_status=ServerStatus(
1146+
status=issues.StatusCode.SUCCESS,
1147+
issues=[],
1148+
),
1149+
server_message=TestMessage(),
1150+
)
1151+
)
11501152
await wait_for_fast(logged.wait())
11511153

11521154
stream_reader._logger.exception.assert_called_once()

0 commit comments

Comments
 (0)