Skip to content

Commit e799295

Browse files
committed
fix linter
1 parent efe1612 commit e799295

4 files changed

Lines changed: 7 additions & 17 deletions

File tree

‎src/base/kafka/config.py‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,8 @@
2727
KAFKA_TRANSACTION_BATCH_CONFIG = CONFIG["environment"].get(
2828
"kafka_transaction_batch", {}
2929
)
30-
KAFKA_TRANSACTION_BATCH_STAGE_CONFIG = KAFKA_TRANSACTION_BATCH_CONFIG.get(
31-
"stages", {}
32-
)
33-
KAFKA_TRANSACTION_BATCH_TOPIC_CONFIG = KAFKA_TRANSACTION_BATCH_CONFIG.get(
34-
"topics", {}
35-
)
30+
KAFKA_TRANSACTION_BATCH_STAGE_CONFIG = KAFKA_TRANSACTION_BATCH_CONFIG.get("stages", {})
31+
KAFKA_TRANSACTION_BATCH_TOPIC_CONFIG = KAFKA_TRANSACTION_BATCH_CONFIG.get("topics", {})
3632
KAFKA_TRANSACTION_BATCH_SIZE = int(
3733
os.getenv(
3834
"KAFKA_TRANSACTION_BATCH_SIZE",
@@ -86,6 +82,7 @@ def transaction_batch_settings(
8682
timeout_ms = max(0, int(os.environ["KAFKA_TRANSACTION_BATCH_TIMEOUT_MS"]))
8783
return size, timeout_ms
8884

85+
8986
KAFKA_TOPIC_CONFIG = CONFIG["environment"].get("kafka_topics", {})
9087
KAFKA_TOPIC_DEFAULT_PARTITIONS = int(
9188
os.getenv("KAFKA_TOPIC_PARTITIONS", KAFKA_TOPIC_CONFIG.get("partitions", 12))

‎tests/kafka/test_kafka_batch_config.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ def test_exact_topic_overrides_stage_one_field_at_a_time(self):
6767
"pipeline-inspector_to_detector-domainator",
6868
stage="data_analysis.detector",
6969
stage_config={"detector": {"size": 10, "timeout_ms": 25}},
70-
topic_config={
71-
"pipeline-inspector_to_detector-domainator": {"size": 3}
72-
},
70+
topic_config={"pipeline-inspector_to_detector-domainator": {"size": 3}},
7371
),
7472
)
7573

‎tests/kafka/test_kafka_eos_batch.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,7 @@ def test_transaction_can_succeed_after_membership_recovery(
164164
self.assertEqual(2, producer.begin_transaction.call_count)
165165

166166
@patch("src.base.kafka.producer.Producer")
167-
def test_revoked_batch_is_rejected_before_a_transaction_begins(
168-
self, mock_producer
169-
):
167+
def test_revoked_batch_is_rejected_before_a_transaction_begins(self, mock_producer):
170168
producer = mock_producer.return_value
171169
consumer = MagicMock()
172170
consumer.ensure_batch_assignment_current.side_effect = (

‎tests/prefilter/test_prefilter.py‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,12 @@ def test_domainator_prefilter_forwards_only_names_with_subdomains(
187187
[
188188
"domain_name",
189189
"RegEx",
190-
r"^(?=.{1,253}$)((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+"
191-
r"[A-Za-z]{2,63}$",
190+
r"^(?=.{1,253}$)((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+" r"[A-Za-z]{2,63}$",
192191
],
193192
]
194193
sut = Prefilter(
195194
consume_topic="pipeline-batch_sender_to_prefilter-domainator_filter",
196-
produce_topics=[
197-
"pipeline-prefilter_to_inspector-domainator_inspector"
198-
],
195+
produce_topics=["pipeline-prefilter_to_inspector-domainator_inspector"],
199196
relevance_function_name="check_domainator_relevance",
200197
validation_config=validation_config,
201198
)

0 commit comments

Comments
 (0)