diff --git a/streampipes-client-python/.pre-commit-config.yaml b/streampipes-client-python/.pre-commit-config.yaml index 3c27eede8a..38b2663762 100644 --- a/streampipes-client-python/.pre-commit-config.yaml +++ b/streampipes-client-python/.pre-commit-config.yaml @@ -17,10 +17,11 @@ files: streampipes/|tests/ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.6.0 hooks: - id: check-json - id: check-yaml + - id: check-toml - id: end-of-file-fixer - id: trailing-whitespace - id: mixed-line-ending @@ -89,4 +90,4 @@ repos: language: python types: [ python ] entry: flake8 --max-line-length 120 - verbose: true \ No newline at end of file + verbose: true diff --git a/streampipes-client-python/streampipes/client/config.py b/streampipes-client-python/streampipes/client/config.py index 336bcf5ece..36b0618ad9 100644 --- a/streampipes-client-python/streampipes/client/config.py +++ b/streampipes-client-python/streampipes/client/config.py @@ -64,5 +64,3 @@ class StreamPipesClientConfig: https_disabled: Optional[bool] = False port: Optional[int] = 80 additional_headers: Optional[Dict[str, str]] = field(default_factory=dict) - - diff --git a/streampipes-client-python/streampipes/endpoint/api/data_lake_measure.py b/streampipes-client-python/streampipes/endpoint/api/data_lake_measure.py index 5d61e50417..ebb2584651 100644 --- a/streampipes-client-python/streampipes/endpoint/api/data_lake_measure.py +++ b/streampipes-client-python/streampipes/endpoint/api/data_lake_measure.py @@ -326,7 +326,7 @@ def _resource_cls(self) -> Type[QueryResult]: @property def _container_cls(self) -> Type[ResourceContainer]: """Defines the model container class the endpoint refers to. - + Returns ------- [DataLakeMeasures][streampipes.model.container.DataLakeMeasures] diff --git a/streampipes-client-python/streampipes/function_zoo/river_function.py b/streampipes-client-python/streampipes/function_zoo/river_function.py index 55c057cf35..910097eef2 100644 --- a/streampipes-client-python/streampipes/function_zoo/river_function.py +++ b/streampipes-client-python/streampipes/function_zoo/river_function.py @@ -178,7 +178,7 @@ def __init__( name="prediction", attributes=attributes, broker=get_broker_description(client.dataStreamApi.get(stream_ids[0])), # type: ignore - stream_id=stream_ids[0] + stream_id=stream_ids[0], ) function_definition = FunctionDefinition(consumed_streams=stream_ids).add_output_data_stream(output_stream) self.sp_function = RiverFunction( diff --git a/streampipes-client-python/streampipes/functions/utils/data_stream_generator.py b/streampipes-client-python/streampipes/functions/utils/data_stream_generator.py index 11b333d412..fc2491051d 100644 --- a/streampipes-client-python/streampipes/functions/utils/data_stream_generator.py +++ b/streampipes-client-python/streampipes/functions/utils/data_stream_generator.py @@ -16,7 +16,7 @@ # from enum import Enum -from typing import Dict, Optional +from typing import Dict from streampipes.functions.broker import SupportedBroker from streampipes.model.common import ( @@ -112,9 +112,7 @@ def create_data_stream( protocol.topic_definition.actual_topic_name = f"org.apache.streampipes.connect.{sanitized_stream_id}" data_stream = DataStream( - name=name, - event_schema=event_schema, - event_grounding=EventGrounding(transport_protocols=transport_protocols) + name=name, event_schema=event_schema, event_grounding=EventGrounding(transport_protocols=transport_protocols) ) data_stream.element_id = sanitized_stream_id diff --git a/streampipes-client-python/tests/functions/test_function_handler.py b/streampipes-client-python/tests/functions/test_function_handler.py index c4968539e0..d7fa3348aa 100644 --- a/streampipes-client-python/tests/functions/test_function_handler.py +++ b/streampipes-client-python/tests/functions/test_function_handler.py @@ -373,9 +373,7 @@ def save_event(self, event: Dict[str, Any]): ) ) - output_stream = create_data_stream("test", - attributes={"number": RuntimeType.INTEGER.value}, - stream_id='a1d') + output_stream = create_data_stream("test", attributes={"number": RuntimeType.INTEGER.value}, stream_id="a1d") test_function = TestFunctionOutput( function_definition=FunctionDefinition( consumed_streams=["urn:streampipes.apache.org:eventstream:uPDKLI"] @@ -438,10 +436,7 @@ def save_event(self, event: Dict[str, Any]): ) output_stream = create_data_stream( - "test", - stream_id='a1c', - attributes={"number": RuntimeType.INTEGER.value}, - broker=SupportedBroker.KAFKA + "test", stream_id="a1c", attributes={"number": RuntimeType.INTEGER.value}, broker=SupportedBroker.KAFKA ) test_function = TestFunctionOutput( function_definition=FunctionDefinition( diff --git a/streampipes-client-python/tests/functions/test_river_function.py b/streampipes-client-python/tests/functions/test_river_function.py index 73f5a52fa1..4d0e09e70b 100644 --- a/streampipes-client-python/tests/functions/test_river_function.py +++ b/streampipes-client-python/tests/functions/test_river_function.py @@ -58,7 +58,7 @@ def setUp(self) -> None: self.data_stream = create_data_stream( "test", attributes={"number": RuntimeType.FLOAT.value, "bool": RuntimeType.BOOLEAN.value}, - stream_id="sample-stream" + stream_id="sample-stream", ).to_dict() self.test_stream_data = [