From 4604e435c17fd1f678cda1f20cbd9ad25e163297 Mon Sep 17 00:00:00 2001 From: TheByronHimes Date: Thu, 7 Dec 2023 15:23:50 +0000 Subject: [PATCH] Fix documentation blips and remove an unneeded var --- src/hexkit/providers/akafka/provider.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/hexkit/providers/akafka/provider.py b/src/hexkit/providers/akafka/provider.py index 1a3f4004..238576ea 100644 --- a/src/hexkit/providers/akafka/provider.py +++ b/src/hexkit/providers/akafka/provider.py @@ -82,7 +82,7 @@ class KafkaConfig(BaseSettings): kafka_ssl_cafile: str = Field( default="", description="Certificate Authority file path containing certificates" - + " used to sign broker certificates. If a CA not specified, the default" + + " used to sign broker certificates. If a CA is not specified, the default" + " system CA will be used if found by OpenSSL.", ) kafka_ssl_certfile: str = Field( @@ -102,8 +102,8 @@ class KafkaConfig(BaseSettings): examples=[True, False], description=( "A flag, which, if False, will result in an error when trying to publish an" - + "event without a valid correlation ID set for the context. If True, the a" - + "newly correlation ID will be generated and used in the event header." + + " event without a valid correlation ID set for the context. If True, the a" + + " newly correlation ID will be generated and used in the event header." ), ) @@ -214,13 +214,11 @@ async def construct( ), ) - generate_correlation_id = config.generate_correlation_id - try: await producer.start() yield cls( producer=producer, - generate_correlation_id=generate_correlation_id, + generate_correlation_id=config.generate_correlation_id, ) finally: await producer.stop() @@ -291,7 +289,7 @@ def headers_as_dict(event: ConsumerEvent) -> dict[str, str]: def get_header_value(header_name: str, headers: dict[str, str]) -> str: - """Extract the given header out of a ConsumerEvent.""" + """Extract the given value from the dict headers and raise an error if not found.""" try: return headers[header_name] except KeyError as err: