Skip to content

Commit

Permalink
Linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mátyás Kuti committed Nov 8, 2023
1 parent f80341e commit 724f1b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion karapace/kafka_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,6 @@ def get_offsets(self, topic: str, partition_id: int) -> dict[str, int]:
except KafkaException as exc:
code = exc.args[0].code()
if code < 0:
raise UnknownTopicOrPartitionError()
raise UnknownTopicOrPartitionError() from exc
raise_from_kafkaexception(exc)
return {"beginning_offset": startoffset.offset, "end_offset": endoffset.offset}
6 changes: 3 additions & 3 deletions tests/integration/test_kafka_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from kafka import KafkaProducer
from kafka.errors import UnknownTopicOrPartitionError
from karapace.kafka_admin import ConfigSource, KafkaAdminClient, NewTopic
from tests.utils import new_topic
from tests.utils import new_topic as create_new_topic

import pytest

Expand All @@ -21,7 +21,7 @@ def test_cluster_metadata_brokers(self, admin_client: KafkaAdminClient) -> None:
assert len(cluster_metadata["brokers"]) == 1, "Only one broker during tests"

def test_cluster_metadata_all_topics(self, admin_client: KafkaAdminClient) -> None:
topic_names = [new_topic(admin_client) for _ in range(5)]
topic_names = [create_new_topic(admin_client) for _ in range(5)]

topics_metadata = admin_client.cluster_metadata()["topics"]

Expand Down Expand Up @@ -131,7 +131,7 @@ def test_get_offsets_raises_for_unknown_partition(self, admin_client: KafkaAdmin

class TestDeleteTopic:
def test_delete_topic(self, admin_client: KafkaAdminClient) -> None:
topic_name = new_topic(admin_client)
topic_name = create_new_topic(admin_client)
topics_metadata_before_delete = admin_client.cluster_metadata()["topics"]

admin_client.delete_topic(topic_name)
Expand Down

0 comments on commit 724f1b8

Please sign in to comment.