From be9b63d27f5a728ce6192f9155f21dfedd94398c Mon Sep 17 00:00:00 2001 From: Jozef Volak Date: Fri, 10 Nov 2023 10:43:12 +0100 Subject: [PATCH] [kafka] fix missing annotations in kafka worker --- .../kafka/frinx_worker/kafka/__init__.py | 10 +++++----- .../frinx_worker/kafka/workflows/__init__.py | 20 +++++++++---------- misc/python/kafka/pyproject.toml | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/misc/python/kafka/frinx_worker/kafka/__init__.py b/misc/python/kafka/frinx_worker/kafka/__init__.py index a10557f..4c344b1 100644 --- a/misc/python/kafka/frinx_worker/kafka/__init__.py +++ b/misc/python/kafka/frinx_worker/kafka/__init__.py @@ -28,11 +28,11 @@ class ExecutionProperties(TaskExecutionProperties): transform_string_to_json_valid: bool = True class WorkerDefinition(TaskDefinition): - name = 'Kafka_publish' - description = 'Publish message to kafka broker' - labels = ['KAFKA'] - timeout_seconds = 60 - response_timeout_seconds = 60 + name: str = 'Kafka_publish' + description: str = 'Publish message to kafka broker' + labels: list[str] = ['KAFKA'] + timeout_seconds: int = 60 + response_timeout_seconds: int = 60 class WorkerInput(TaskInput): bootstrap_servers: str diff --git a/misc/python/kafka/frinx_worker/kafka/workflows/__init__.py b/misc/python/kafka/frinx_worker/kafka/workflows/__init__.py index 9cdefe4..6907774 100644 --- a/misc/python/kafka/frinx_worker/kafka/workflows/__init__.py +++ b/misc/python/kafka/frinx_worker/kafka/workflows/__init__.py @@ -9,20 +9,20 @@ class KafkaProducer(WorkflowImpl): - name = 'Kafka_producer' - version = 1 - description = 'Simple Kafka producer' - labels = ['KAFKA'] + name: str = 'Kafka_producer' + version: int = 1 + description: str = 'Simple Kafka producer' + labels: list[str] = ['KAFKA'] class WorkflowInput(WorkflowImpl.WorkflowInput): - servers = WorkflowInputField( + servers: WorkflowInputField = WorkflowInputField( name='servers', frontend_default_value='kafka:9092', description='Kafka bootstrap servers. Separated with coma', type=FrontendWFInputFieldType.STRING, ) - security = WorkflowInputField( + security: WorkflowInputField = WorkflowInputField( name='security', frontend_default_value='SSL', description='Request url', @@ -30,28 +30,28 @@ class WorkflowInput(WorkflowImpl.WorkflowInput): options=[str(status) for status in SecurityProtocolType] ) - message = WorkflowInputField( + message: WorkflowInputField = WorkflowInputField( name='message', frontend_default_value='hello telemetry &^%#$#!', description='Request url', type=FrontendWFInputFieldType.TEXTAREA, ) - key = WorkflowInputField( + key: WorkflowInputField = WorkflowInputField( name='key', frontend_default_value='telemetry_key', description='Request url', type=FrontendWFInputFieldType.TEXTAREA, ) - topic = WorkflowInputField( + topic: WorkflowInputField = WorkflowInputField( name='topic', frontend_default_value='telemetry', description='kafka topic', type=FrontendWFInputFieldType.STRING, ) - ssl_conf = WorkflowInputField( + ssl_conf: WorkflowInputField = WorkflowInputField( name='ssl_conf', frontend_default_value="""{ "ssl_check_hostname": true, diff --git a/misc/python/kafka/pyproject.toml b/misc/python/kafka/pyproject.toml index a9cb4a8..fa2495c 100644 --- a/misc/python/kafka/pyproject.toml +++ b/misc/python/kafka/pyproject.toml @@ -20,7 +20,7 @@ packages = [{ include = "frinx_worker" }] name = "frinx-kafka-worker" description = "Conductor Kafka worker for Frinx Machine" authors = ["Jozef Volak "] -version = "1.0.0" +version = "1.0.1" readme = ["README.md", "CHANGELOG.md"] keywords = ["frinx-machine", "kafka", "worker"] license = "Apache 2.0"