diff --git a/streampipes-client-python/.pre-commit-config.yaml b/streampipes-client-python/.pre-commit-config.yaml index d554ad2cc7..23786aa8c8 100644 --- a/streampipes-client-python/.pre-commit-config.yaml +++ b/streampipes-client-python/.pre-commit-config.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -files: streampipes_client/|tests/ +files: streampipes/|tests/ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.2.0 diff --git a/streampipes-client-python/Makefile b/streampipes-client-python/Makefile index 6413785b3b..7d9578af86 100644 --- a/streampipes-client-python/Makefile +++ b/streampipes-client-python/Makefile @@ -24,7 +24,7 @@ doc: .PHONY: lint lint: - flake8 streampipes_client --max-line-length 120 + flake8 streampipes --max-line-length 120 .PHONY: livedoc livedoc: doc @@ -32,7 +32,7 @@ livedoc: doc .PHONY: mypy mypy: - mypy streampipes_client --warn-unused-ignores --warn-redundant-casts --pretty + mypy streampipes --warn-unused-ignores --warn-redundant-casts --pretty .PHONY: rebase rebase: @@ -41,9 +41,9 @@ rebase: .PHONY: reformat-all reformat-all: pyupgrade --py38 --keep-runtime-typing - autoflake -r --remove-all-unused-imports --expand-star-imports --in-place streampipes_client tests - isort --profile black streampipes_client tests - black --line-length=120 streampipes_client tests + autoflake -r --remove-all-unused-imports --expand-star-imports --in-place streampipes tests + isort --profile black streampipes tests + black --line-length=120 streampipes tests .PHONY: pre-commit pre-commit: @@ -51,4 +51,4 @@ pre-commit: .PHONY: unit-tests unit-tests: - pytest --cov=streampipes_client tests/ --cov-fail-under=90 --cov-report term-missing --no-cov-on-fail + pytest --cov=streampipes tests/ --cov-fail-under=90 --cov-report term-missing --no-cov-on-fail diff --git a/streampipes-client-python/README.md b/streampipes-client-python/README.md index f887e1a4e1..445c4b15f8 100644 --- a/streampipes-client-python/README.md +++ b/streampipes-client-python/README.md @@ -46,28 +46,54 @@ and the amazing universe of data analytics libraries in Python.

As a quick example, we demonstrate how to set up and configure a StreamPipes client. ```python ->>> from streampipes_client.client import StreamPipesClient ->>> from streampipes_client.client.client_config import StreamPipesClientConfig ->>> from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials +>> > from streampipes.client import StreamPipesClient +>> > from streampipes.client.client_config import StreamPipesClientConfig +>> > from streampipes.client.credential_provider import StreamPipesApiKeyCredentials ->>> config = StreamPipesClientConfig( -... credential_provider=StreamPipesApiKeyCredentials( -... username="test@streampipes.apache.org", -... api_key="DEMO-KEY", -... ), -... host_address="localhost", -... http_disabled=True, -... port=80 +>> > config = StreamPipesClientConfig( + ... +credential_provider = StreamPipesApiKeyCredentials( + ... +username = "test@streampipes.apache.org", + ... +api_key = "DEMO-KEY", + ... ), +... +host_address = "localhost", + ... +http_disabled = True, + ... +port = 80 ...) ->>> client = StreamPipesClient(client_config=config) ->>> client.describe() +>> > client = StreamPipesClient(client_config=config) +>> > client.describe() -Hi there! -You are connected to a StreamPipes instance running at http://localhost:80. -The following StreamPipes resources are available with this client: -6x DataStreams -1x DataLakeMeasures +Hi +there! +You +are +connected +to +a +StreamPipes +instance +running +at +http: // localhost: 80. +The +following +StreamPipes +resources +are +available +with this client: + 6 +x +DataStreams +1 +x +DataLakeMeasures ``` For more information about how to use the StreamPipes client visit our [introduction example](). \ No newline at end of file diff --git a/streampipes-client-python/docs/examples/1-introduction-to-streampipes-python-client.ipynb b/streampipes-client-python/docs/examples/1-introduction-to-streampipes-python-client.ipynb index d6643b91e4..70bc8259ed 100644 --- a/streampipes-client-python/docs/examples/1-introduction-to-streampipes-python-client.ipynb +++ b/streampipes-client-python/docs/examples/1-introduction-to-streampipes-python-client.ipynb @@ -63,9 +63,9 @@ "execution_count": 3, "outputs": [], "source": [ - "from streampipes_client.client import StreamPipesClient\n", - "from streampipes_client.client.client_config import StreamPipesClientConfig\n", - "from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials" + "from streampipes.client import StreamPipesClient\n", + "from streampipes.client.config import StreamPipesClientConfig\n", + "from streampipes.client.credential_provider import StreamPipesApiKeyCredentials" ], "metadata": { "collapsed": false diff --git a/streampipes-client-python/docs/examples/2-extracting-data-from-the-streampipes-data-lake.ipynb b/streampipes-client-python/docs/examples/2-extracting-data-from-the-streampipes-data-lake.ipynb index b784fe5375..79a148fbad 100644 --- a/streampipes-client-python/docs/examples/2-extracting-data-from-the-streampipes-data-lake.ipynb +++ b/streampipes-client-python/docs/examples/2-extracting-data-from-the-streampipes-data-lake.ipynb @@ -19,9 +19,9 @@ "execution_count": 1, "outputs": [], "source": [ - "from streampipes_client.client import StreamPipesClient\n", - "from streampipes_client.client.client_config import StreamPipesClientConfig\n", - "from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials" + "from streampipes.client import StreamPipesClient\n", + "from streampipes.client.config import StreamPipesClientConfig\n", + "from streampipes.client.credential_provider import StreamPipesApiKeyCredentials" ], "metadata": { "collapsed": false diff --git a/streampipes-client-python/docs/examples/3-getting-live-data-from-the-streampipes-data-stream.ipynb b/streampipes-client-python/docs/examples/3-getting-live-data-from-the-streampipes-data-stream.ipynb index 3f3a3c9c31..53a95c8ddd 100644 --- a/streampipes-client-python/docs/examples/3-getting-live-data-from-the-streampipes-data-stream.ipynb +++ b/streampipes-client-python/docs/examples/3-getting-live-data-from-the-streampipes-data-stream.ipynb @@ -15,9 +15,9 @@ "metadata": {}, "outputs": [], "source": [ - "from streampipes_client.client import StreamPipesClient\n", - "from streampipes_client.client.client_config import StreamPipesClientConfig\n", - "from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials" + "from streampipes.client import StreamPipesClient\n", + "from streampipes.client.config import StreamPipesClientConfig\n", + "from streampipes.client.credential_provider import StreamPipesApiKeyCredentials" ] }, { @@ -238,10 +238,10 @@ "import pandas as pd\n", "from datetime import datetime\n", "import matplotlib.pyplot as plt\n", - "from streampipes_client.functions.function_handler import FunctionHandler\n", - "from streampipes_client.functions.registration import Registration\n", - "from streampipes_client.functions.streampipes_function import StreamPipesFunction\n", - "from streampipes_client.functions.utils.function_context import FunctionContext\n", + "from streampipes.functions.function_handler import FunctionHandler\n", + "from streampipes.functions.registration import Registration\n", + "from streampipes.functions.streampipes_function import StreamPipesFunction\n", + "from streampipes.functions.utils.function_context import FunctionContext\n", "\n", "class ExampleFunction(StreamPipesFunction):\n", "\n", @@ -610,4 +610,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} diff --git a/streampipes-client-python/docs/getting-started/quickstart.md b/streampipes-client-python/docs/getting-started/quickstart.md index 9a0a2db040..a7ab6dd825 100644 --- a/streampipes-client-python/docs/getting-started/quickstart.md +++ b/streampipes-client-python/docs/getting-started/quickstart.md @@ -21,35 +21,61 @@ As a quick example, we demonstrate how to set up and configure a StreamPipes client. ```python ->>> from streampipes_client.client import StreamPipesClient ->>> from streampipes_client.client.client_config import StreamPipesClientConfig ->>> from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials - ->>> config = StreamPipesClientConfig( -... credential_provider=StreamPipesApiKeyCredentials( -... username="test@streampipes.apache.org", -... api_key="DEMO-KEY", -... ), -... host_address="localhost", -... http_disabled=True, -... port=80 +>> > from streampipes.client import StreamPipesClient +>> > from streampipes.client.client_config import StreamPipesClientConfig +>> > from streampipes.client.credential_provider import StreamPipesApiKeyCredentials + +>> > config = StreamPipesClientConfig( + ... +credential_provider = StreamPipesApiKeyCredentials( + ... +username = "test@streampipes.apache.org", + ... +api_key = "DEMO-KEY", + ... ), +... +host_address = "localhost", + ... +http_disabled = True, + ... +port = 80 ...) ->>> client = StreamPipesClient(client_config=config) ->>> client.describe() +>> > client = StreamPipesClient(client_config=config) +>> > client.describe() -Hi there! -You are connected to a StreamPipes instance running at http://localhost:80. -The following StreamPipes resources are available with this client: -6x DataStreams -1x DataLakeMeasures +Hi +there! +You +are +connected +to +a +StreamPipes +instance +running +at +http: // localhost: 80. +The +following +StreamPipes +resources +are +available +with this client: + 6 +x +DataStreams +1 +x +DataLakeMeasures ```
Alternatively, you can provide your credentials via environment variables. Simply define your credential provider as follows: ```python ->>> from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials +>> > from streampipes.client.credential_provider import StreamPipesApiKeyCredentials StreamPipesApiKeyCredentials.from_env(username_env="USER", api_key_env="API-KEY") ``` diff --git a/streampipes-client-python/docs/index.md b/streampipes-client-python/docs/index.md index 8555c9cc71..093db87bc3 100644 --- a/streampipes-client-python/docs/index.md +++ b/streampipes-client-python/docs/index.md @@ -36,18 +36,9 @@ and the amazing universe of data analytics libraries in Python.


-** ❗❗❗IMPORTANT ❗❗❗** -
-
-**The current version of this Python client is still in alpha phase at best.** +**💡 The current version of this Python client is still a beta version.**
**This means that it is still heavily under development, which may result in frequent and extensive API changes, unstable behavior, etc.** -
-**Please consider it only as a sneak preview.** -
-
-**❗❗❗ IMPORTANT ❗❗❗** -
## ⚡️ Quickstart @@ -56,33 +47,45 @@ As a quick example, we demonstrate how to set up and configure a StreamPipes cli In addition, we will get the available data lake measures out of StreamPipes. ```python ->>> from streampipes_client.client import StreamPipesClient ->>> from streampipes_client.client.client_config import StreamPipesClientConfig ->>> from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials - ->>> config = StreamPipesClientConfig( -... credential_provider=StreamPipesApiKeyCredentials( -... username="test@streampipes.apache.org", -... api_key="DEMO-KEY", -... ), -... host_address="localhost", -... http_disabled=True, -... port=80 +>> > from streampipes.client import StreamPipesClient +>> > from streampipes.client.client_config import StreamPipesClientConfig +>> > from streampipes.client.credential_provider import StreamPipesApiKeyCredentials + +>> > config = StreamPipesClientConfig( + ... +credential_provider = StreamPipesApiKeyCredentials( + ... +username = "test@streampipes.apache.org", + ... +api_key = "DEMO-KEY", + ... ), +... +host_address = "localhost", + ... +http_disabled = True, + ... +port = 80 ...) ->>> client = StreamPipesClient(client_config=config) +>> > client = StreamPipesClient(client_config=config) # get all available datat lake measures ->>> measures = client.dataLakeMeasureApi.all() +>> > measures = client.dataLakeMeasureApi.all() # get amount of retrieved measures ->>> len(measures) +>> > len(measures) 1 # inspect the data lake measures as pandas dataframe ->>> measures.to_pandas() - measure_name timestamp_field ... pipeline_is_running num_event_properties -0 test s0::timestamp ... False 2 +>> > measures.to_pandas() +measure_name +timestamp_field...pipeline_is_running +num_event_properties +0 +test +s0::timestamp... +False +2 [1 rows x 6 columns] ```
@@ -90,7 +93,7 @@ Alternatively, you can provide your credentials via environment variables. Simply define your credential provider as follows: ```python ->>> from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials +>> > from streampipes.client.credential_provider import StreamPipesApiKeyCredentials StreamPipesApiKeyCredentials.from_env(username_env="USER", api_key_env="API-KEY") ``` diff --git a/streampipes-client-python/docs/scripts/gen_ref_pages.py b/streampipes-client-python/docs/scripts/gen_ref_pages.py index 9d935d0a7e..b9e45f9fe3 100644 --- a/streampipes-client-python/docs/scripts/gen_ref_pages.py +++ b/streampipes-client-python/docs/scripts/gen_ref_pages.py @@ -21,9 +21,9 @@ nav = mkdocs_gen_files.Nav() -for path in sorted(Path("streampipes_client").rglob("*.py")): - module_path = path.relative_to("streampipes_client").with_suffix("") - doc_path = path.relative_to("streampipes_client").with_suffix(".md") +for path in sorted(Path("streampipes").rglob("*.py")): + module_path = path.relative_to("streampipes").with_suffix("") + doc_path = path.relative_to("streampipes").with_suffix(".md") full_doc_path = Path("reference", doc_path) parts = list(module_path.parts) @@ -42,7 +42,7 @@ with mkdocs_gen_files.open(full_doc_path, "w+") as fd: identifier = ".".join(parts) - print(f"::: streampipes_client.{identifier}", file=fd) + print(f"::: streampipes.{identifier}", file=fd) mkdocs_gen_files.set_edit_path(full_doc_path, path) diff --git a/streampipes-client-python/setup.py b/streampipes-client-python/setup.py index e89c0f1364..0bce7ca84a 100644 --- a/streampipes-client-python/setup.py +++ b/streampipes-client-python/setup.py @@ -21,7 +21,7 @@ import setuptools # Package meta-data. -NAME = "streampipes-client" +NAME = "streampipes" DESCRIPTION = "Python client for Apache StreamPipes" LONG_DESCRIPTION_CONTENT_TYPE = "text/markdown" URL = "https://github.com/apache/streampipes/" @@ -74,7 +74,7 @@ # Load the package's __version__.py module as a dictionary. about = {} -with open(os.path.join(here, "streampipes_client", "__version__.py")) as f: +with open(os.path.join(here, "streampipes", "__version__.py")) as f: exec(f.read(), about) # Where the magic happens: diff --git a/streampipes-client-python/streampipes_client/__init__.py b/streampipes-client-python/streampipes/__init__.py similarity index 100% rename from streampipes-client-python/streampipes_client/__init__.py rename to streampipes-client-python/streampipes/__init__.py diff --git a/streampipes-client-python/streampipes_client/__version__.py b/streampipes-client-python/streampipes/__version__.py similarity index 100% rename from streampipes-client-python/streampipes_client/__version__.py rename to streampipes-client-python/streampipes/__version__.py diff --git a/streampipes-client-python/streampipes_client/client/__init__.py b/streampipes-client-python/streampipes/client/__init__.py similarity index 100% rename from streampipes-client-python/streampipes_client/client/__init__.py rename to streampipes-client-python/streampipes/client/__init__.py diff --git a/streampipes-client-python/streampipes_client/client/client.py b/streampipes-client-python/streampipes/client/client.py similarity index 94% rename from streampipes-client-python/streampipes_client/client/client.py rename to streampipes-client-python/streampipes/client/client.py index c901666516..2c2c82dceb 100644 --- a/streampipes-client-python/streampipes_client/client/client.py +++ b/streampipes-client-python/streampipes/client/client.py @@ -28,9 +28,9 @@ from typing import Dict, Optional from requests import Session -from streampipes_client.client.client_config import StreamPipesClientConfig -from streampipes_client.endpoint.api import DataLakeMeasureEndpoint, DataStreamEndpoint -from streampipes_client.endpoint.endpoint import APIEndpoint +from streampipes.client.config import StreamPipesClientConfig +from streampipes.endpoint.api import DataLakeMeasureEndpoint, DataStreamEndpoint +from streampipes.endpoint.endpoint import APIEndpoint logger = logging.getLogger(__name__) @@ -55,9 +55,9 @@ class StreamPipesClient: Examples -------- - >>> from streampipes_client.client import StreamPipesClient - >>> from streampipes_client.client.client_config import StreamPipesClientConfig - >>> from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials + >>> from streampipes.client import StreamPipesClient + >>> from streampipes.client.client_config import StreamPipesClientConfig + >>> from streampipes.client.credential_provider import StreamPipesApiKeyCredentials >>> client_config = StreamPipesClientConfig( ... credential_provider=StreamPipesApiKeyCredentials( diff --git a/streampipes-client-python/streampipes_client/client/client_config.py b/streampipes-client-python/streampipes/client/config.py similarity index 96% rename from streampipes-client-python/streampipes_client/client/client_config.py rename to streampipes-client-python/streampipes/client/config.py index 96ff045a71..05e3729b14 100644 --- a/streampipes-client-python/streampipes_client/client/client_config.py +++ b/streampipes-client-python/streampipes/client/config.py @@ -28,7 +28,7 @@ ] -from streampipes_client.client.credential_provider import CredentialProvider +from streampipes.client.credential_provider import CredentialProvider @dataclass diff --git a/streampipes-client-python/streampipes_client/client/credential_provider.py b/streampipes-client-python/streampipes/client/credential_provider.py similarity index 100% rename from streampipes-client-python/streampipes_client/client/credential_provider.py rename to streampipes-client-python/streampipes/client/credential_provider.py diff --git a/streampipes-client-python/streampipes_client/endpoint/__init__.py b/streampipes-client-python/streampipes/endpoint/__init__.py similarity index 100% rename from streampipes-client-python/streampipes_client/endpoint/__init__.py rename to streampipes-client-python/streampipes/endpoint/__init__.py diff --git a/streampipes-client-python/streampipes_client/endpoint/api/__init__.py b/streampipes-client-python/streampipes/endpoint/api/__init__.py similarity index 100% rename from streampipes-client-python/streampipes_client/endpoint/api/__init__.py rename to streampipes-client-python/streampipes/endpoint/api/__init__.py diff --git a/streampipes-client-python/streampipes_client/endpoint/api/data_lake_measure.py b/streampipes-client-python/streampipes/endpoint/api/data_lake_measure.py similarity index 88% rename from streampipes-client-python/streampipes_client/endpoint/api/data_lake_measure.py rename to streampipes-client-python/streampipes/endpoint/api/data_lake_measure.py index d9f37dd0b4..b39ca5d2b5 100644 --- a/streampipes-client-python/streampipes_client/endpoint/api/data_lake_measure.py +++ b/streampipes-client-python/streampipes/endpoint/api/data_lake_measure.py @@ -21,10 +21,10 @@ """ from typing import Tuple, Type -from streampipes_client.endpoint.endpoint import APIEndpoint -from streampipes_client.model.container import DataLakeMeasures -from streampipes_client.model.container.resource_container import ResourceContainer -from streampipes_client.model.resource import DataLakeSeries +from streampipes.endpoint.endpoint import APIEndpoint +from streampipes.model.container import DataLakeMeasures +from streampipes.model.container.resource_container import ResourceContainer +from streampipes.model.resource import DataLakeSeries __all__ = [ "DataLakeMeasureEndpoint", @@ -49,9 +49,9 @@ class DataLakeMeasureEndpoint(APIEndpoint): Examples -------- - >>> from streampipes_client.client import StreamPipesClient - >>> from streampipes_client.client.client_config import StreamPipesClientConfig - >>> from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials + >>> from streampipes.client import StreamPipesClient + >>> from streampipes.client.client_config import StreamPipesClientConfig + >>> from streampipes.client.credential_provider import StreamPipesApiKeyCredentials >>> client_config = StreamPipesClientConfig( ... credential_provider=StreamPipesApiKeyCredentials(username="test-user", api_key="api-key"), diff --git a/streampipes-client-python/streampipes_client/endpoint/api/data_stream.py b/streampipes-client-python/streampipes/endpoint/api/data_stream.py similarity index 84% rename from streampipes-client-python/streampipes_client/endpoint/api/data_stream.py rename to streampipes-client-python/streampipes/endpoint/api/data_stream.py index 14bf492659..71c77c9695 100644 --- a/streampipes-client-python/streampipes_client/endpoint/api/data_stream.py +++ b/streampipes-client-python/streampipes/endpoint/api/data_stream.py @@ -20,14 +20,14 @@ """ from typing import Tuple, Type -from streampipes_client.endpoint.endpoint import APIEndpoint -from streampipes_client.model.container import DataStreams +from streampipes.endpoint.endpoint import APIEndpoint +from streampipes.model.container import DataStreams __all__ = [ "DataStreamEndpoint", ] -from streampipes_client.model.container.resource_container import ResourceContainer +from streampipes.model.container.resource_container import ResourceContainer class DataStreamEndpoint(APIEndpoint): @@ -44,9 +44,9 @@ class DataStreamEndpoint(APIEndpoint): Examples -------- - >>> from streampipes_client.client import StreamPipesClient - >>> from streampipes_client.client.client_config import StreamPipesClientConfig - >>> from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials + >>> from streampipes.client import StreamPipesClient + >>> from streampipes.client.client_config import StreamPipesClientConfig + >>> from streampipes.client.credential_provider import StreamPipesApiKeyCredentials >>> client_config = StreamPipesClientConfig( ... credential_provider=StreamPipesApiKeyCredentials(username="test-user", api_key="api-key"), diff --git a/streampipes-client-python/streampipes_client/endpoint/endpoint.py b/streampipes-client-python/streampipes/endpoint/endpoint.py similarity index 97% rename from streampipes-client-python/streampipes_client/endpoint/endpoint.py rename to streampipes-client-python/streampipes/endpoint/endpoint.py index dcea73af5e..4495cde1c3 100644 --- a/streampipes-client-python/streampipes_client/endpoint/endpoint.py +++ b/streampipes-client-python/streampipes/endpoint/endpoint.py @@ -34,10 +34,10 @@ "MessagingEndpoint", ] -from streampipes_client.endpoint.exceptions import MessagingEndpointNotConfiguredError -from streampipes_client.functions.broker.broker import Broker -from streampipes_client.model.container.resource_container import ResourceContainer -from streampipes_client.model.resource.resource import Resource +from streampipes.endpoint.exceptions import MessagingEndpointNotConfiguredError +from streampipes.functions.broker.broker import Broker +from streampipes.model.container.resource_container import ResourceContainer +from streampipes.model.resource.resource import Resource logger = logging.getLogger(__name__) diff --git a/streampipes-client-python/streampipes_client/endpoint/exceptions.py b/streampipes-client-python/streampipes/endpoint/exceptions.py similarity index 100% rename from streampipes-client-python/streampipes_client/endpoint/exceptions.py rename to streampipes-client-python/streampipes/endpoint/exceptions.py diff --git a/streampipes-client-python/streampipes_client/endpoint/messaging/__init__.py b/streampipes-client-python/streampipes/endpoint/messaging/__init__.py similarity index 100% rename from streampipes-client-python/streampipes_client/endpoint/messaging/__init__.py rename to streampipes-client-python/streampipes/endpoint/messaging/__init__.py diff --git a/streampipes-client-python/streampipes_client/functions/__init__.py b/streampipes-client-python/streampipes/functions/__init__.py similarity index 100% rename from streampipes-client-python/streampipes_client/functions/__init__.py rename to streampipes-client-python/streampipes/functions/__init__.py diff --git a/streampipes-client-python/streampipes_client/functions/broker/__init__.py b/streampipes-client-python/streampipes/functions/broker/__init__.py similarity index 100% rename from streampipes-client-python/streampipes_client/functions/broker/__init__.py rename to streampipes-client-python/streampipes/functions/broker/__init__.py diff --git a/streampipes-client-python/streampipes_client/functions/broker/broker.py b/streampipes-client-python/streampipes/functions/broker/broker.py similarity index 97% rename from streampipes-client-python/streampipes_client/functions/broker/broker.py rename to streampipes-client-python/streampipes/functions/broker/broker.py index 76767f4ad8..7a34d1798d 100644 --- a/streampipes-client-python/streampipes_client/functions/broker/broker.py +++ b/streampipes-client-python/streampipes/functions/broker/broker.py @@ -18,7 +18,7 @@ from enum import Enum from typing import AsyncIterator -from streampipes_client.model.resource.data_stream import DataStream +from streampipes.model.resource.data_stream import DataStream class SupportedBroker(Enum): diff --git a/streampipes-client-python/streampipes_client/functions/broker/nats_broker.py b/streampipes-client-python/streampipes/functions/broker/nats_broker.py similarity index 97% rename from streampipes-client-python/streampipes_client/functions/broker/nats_broker.py rename to streampipes-client-python/streampipes/functions/broker/nats_broker.py index 46b917ef4e..ac0481305d 100644 --- a/streampipes-client-python/streampipes_client/functions/broker/nats_broker.py +++ b/streampipes-client-python/streampipes/functions/broker/nats_broker.py @@ -18,7 +18,7 @@ from typing import AsyncIterator from nats import connect -from streampipes_client.functions.broker.broker import Broker +from streampipes.functions.broker.broker import Broker logger = logging.getLogger(__name__) diff --git a/streampipes-client-python/streampipes_client/functions/function_handler.py b/streampipes-client-python/streampipes/functions/function_handler.py similarity index 93% rename from streampipes-client-python/streampipes_client/functions/function_handler.py rename to streampipes-client-python/streampipes/functions/function_handler.py index 993fe3a565..e930e11700 100644 --- a/streampipes-client-python/streampipes_client/functions/function_handler.py +++ b/streampipes-client-python/streampipes/functions/function_handler.py @@ -19,13 +19,13 @@ import logging from typing import AsyncIterator, Dict, List -from streampipes_client.client.client import StreamPipesClient -from streampipes_client.functions.broker import Broker, NatsBroker, SupportedBroker -from streampipes_client.functions.registration import Registration -from streampipes_client.functions.utils.async_iter_handler import AsyncIterHandler -from streampipes_client.functions.utils.data_stream_context import DataStreamContext -from streampipes_client.functions.utils.function_context import FunctionContext -from streampipes_client.model.resource.data_stream import DataStream +from streampipes.client.client import StreamPipesClient +from streampipes.functions.broker import Broker, NatsBroker, SupportedBroker +from streampipes.functions.registration import Registration +from streampipes.functions.utils.async_iter_handler import AsyncIterHandler +from streampipes.functions.utils.data_stream_context import DataStreamContext +from streampipes.functions.utils.function_context import FunctionContext +from streampipes.model.resource.data_stream import DataStream logger = logging.getLogger(__name__) diff --git a/streampipes-client-python/streampipes_client/functions/registration.py b/streampipes-client-python/streampipes/functions/registration.py similarity index 95% rename from streampipes-client-python/streampipes_client/functions/registration.py rename to streampipes-client-python/streampipes/functions/registration.py index f1a227b7d5..8d3d059349 100644 --- a/streampipes-client-python/streampipes_client/functions/registration.py +++ b/streampipes-client-python/streampipes/functions/registration.py @@ -16,7 +16,7 @@ # from typing import List -from streampipes_client.functions.streampipes_function import StreamPipesFunction +from streampipes.functions.streampipes_function import StreamPipesFunction class Registration: diff --git a/streampipes-client-python/streampipes_client/functions/streampipes_function.py b/streampipes-client-python/streampipes/functions/streampipes_function.py similarity index 95% rename from streampipes-client-python/streampipes_client/functions/streampipes_function.py rename to streampipes-client-python/streampipes/functions/streampipes_function.py index 248cf82203..f6fd59158b 100644 --- a/streampipes-client-python/streampipes_client/functions/streampipes_function.py +++ b/streampipes-client-python/streampipes/functions/streampipes_function.py @@ -17,8 +17,8 @@ from abc import ABC, abstractmethod from typing import Any, Dict, List, Optional -from streampipes_client.functions.utils.function_context import FunctionContext -from streampipes_client.model.resource import FunctionDefinition +from streampipes.functions.utils.function_context import FunctionContext +from streampipes.model.resource import FunctionDefinition class StreamPipesFunction(ABC): diff --git a/streampipes-client-python/streampipes_client/functions/utils/__init__.py b/streampipes-client-python/streampipes/functions/utils/__init__.py similarity index 100% rename from streampipes-client-python/streampipes_client/functions/utils/__init__.py rename to streampipes-client-python/streampipes/functions/utils/__init__.py diff --git a/streampipes-client-python/streampipes_client/functions/utils/async_iter_handler.py b/streampipes-client-python/streampipes/functions/utils/async_iter_handler.py similarity index 100% rename from streampipes-client-python/streampipes_client/functions/utils/async_iter_handler.py rename to streampipes-client-python/streampipes/functions/utils/async_iter_handler.py diff --git a/streampipes-client-python/streampipes_client/functions/utils/data_stream_context.py b/streampipes-client-python/streampipes/functions/utils/data_stream_context.py similarity index 88% rename from streampipes-client-python/streampipes_client/functions/utils/data_stream_context.py rename to streampipes-client-python/streampipes/functions/utils/data_stream_context.py index 97e3982c17..7e5d39b720 100644 --- a/streampipes-client-python/streampipes_client/functions/utils/data_stream_context.py +++ b/streampipes-client-python/streampipes/functions/utils/data_stream_context.py @@ -16,9 +16,9 @@ # from typing import List -from streampipes_client.functions.broker.broker import Broker -from streampipes_client.functions.streampipes_function import StreamPipesFunction -from streampipes_client.model.resource.data_stream import DataStream +from streampipes.functions.broker.broker import Broker +from streampipes.functions.streampipes_function import StreamPipesFunction +from streampipes.model.resource.data_stream import DataStream class DataStreamContext: diff --git a/streampipes-client-python/streampipes_client/functions/utils/function_context.py b/streampipes-client-python/streampipes/functions/utils/function_context.py similarity index 93% rename from streampipes-client-python/streampipes_client/functions/utils/function_context.py rename to streampipes-client-python/streampipes/functions/utils/function_context.py index 23d2a52efb..0670476883 100644 --- a/streampipes-client-python/streampipes_client/functions/utils/function_context.py +++ b/streampipes-client-python/streampipes/functions/utils/function_context.py @@ -16,8 +16,8 @@ # from typing import Dict, List -from streampipes_client.client.client import StreamPipesClient -from streampipes_client.model.resource.data_stream import DataStream +from streampipes.client.client import StreamPipesClient +from streampipes.model.resource.data_stream import DataStream class FunctionContext: diff --git a/streampipes-client-python/streampipes_client/model/__init__.py b/streampipes-client-python/streampipes/model/__init__.py similarity index 100% rename from streampipes-client-python/streampipes_client/model/__init__.py rename to streampipes-client-python/streampipes/model/__init__.py diff --git a/streampipes-client-python/streampipes_client/model/common.py b/streampipes-client-python/streampipes/model/common.py similarity index 100% rename from streampipes-client-python/streampipes_client/model/common.py rename to streampipes-client-python/streampipes/model/common.py diff --git a/streampipes-client-python/streampipes_client/model/container/__init__.py b/streampipes-client-python/streampipes/model/container/__init__.py similarity index 100% rename from streampipes-client-python/streampipes_client/model/container/__init__.py rename to streampipes-client-python/streampipes/model/container/__init__.py diff --git a/streampipes-client-python/streampipes_client/model/container/data_lake_measures.py b/streampipes-client-python/streampipes/model/container/data_lake_measures.py similarity index 88% rename from streampipes-client-python/streampipes_client/model/container/data_lake_measures.py rename to streampipes-client-python/streampipes/model/container/data_lake_measures.py index e4a00c3e98..6a6af75119 100644 --- a/streampipes-client-python/streampipes_client/model/container/data_lake_measures.py +++ b/streampipes-client-python/streampipes/model/container/data_lake_measures.py @@ -20,9 +20,9 @@ """ from typing import Type -from streampipes_client.model.container.resource_container import ResourceContainer -from streampipes_client.model.resource.data_lake_measure import DataLakeMeasure -from streampipes_client.model.resource.resource import Resource +from streampipes.model.container.resource_container import ResourceContainer +from streampipes.model.resource.data_lake_measure import DataLakeMeasure +from streampipes.model.resource.resource import Resource __all__ = [ "DataLakeMeasures", diff --git a/streampipes-client-python/streampipes_client/model/container/data_streams.py b/streampipes-client-python/streampipes/model/container/data_streams.py similarity index 88% rename from streampipes-client-python/streampipes_client/model/container/data_streams.py rename to streampipes-client-python/streampipes/model/container/data_streams.py index ea7f5086c4..da68f7bef3 100644 --- a/streampipes-client-python/streampipes_client/model/container/data_streams.py +++ b/streampipes-client-python/streampipes/model/container/data_streams.py @@ -20,9 +20,9 @@ """ from typing import Type -from streampipes_client.model.container.resource_container import ResourceContainer -from streampipes_client.model.resource.data_stream import DataStream -from streampipes_client.model.resource.resource import Resource +from streampipes.model.container.resource_container import ResourceContainer +from streampipes.model.resource.data_stream import DataStream +from streampipes.model.resource.resource import Resource __all__ = [ "DataStreams", diff --git a/streampipes-client-python/streampipes_client/model/container/resource_container.py b/streampipes-client-python/streampipes/model/container/resource_container.py similarity index 99% rename from streampipes-client-python/streampipes_client/model/container/resource_container.py rename to streampipes-client-python/streampipes/model/container/resource_container.py index 7173be366c..3bfcddcb8e 100644 --- a/streampipes-client-python/streampipes_client/model/container/resource_container.py +++ b/streampipes-client-python/streampipes/model/container/resource_container.py @@ -35,7 +35,7 @@ "ResourceContainer", ] -from streampipes_client.model.resource.resource import Resource +from streampipes.model.resource.resource import Resource class StreamPipesDataModelError(Exception): diff --git a/streampipes-client-python/streampipes_client/model/resource/__init__.py b/streampipes-client-python/streampipes/model/resource/__init__.py similarity index 100% rename from streampipes-client-python/streampipes_client/model/resource/__init__.py rename to streampipes-client-python/streampipes/model/resource/__init__.py diff --git a/streampipes-client-python/streampipes_client/model/resource/data_lake_measure.py b/streampipes-client-python/streampipes/model/resource/data_lake_measure.py similarity index 94% rename from streampipes-client-python/streampipes_client/model/resource/data_lake_measure.py rename to streampipes-client-python/streampipes/model/resource/data_lake_measure.py index 3526a22eaa..1dcbe3a4a6 100644 --- a/streampipes-client-python/streampipes_client/model/resource/data_lake_measure.py +++ b/streampipes-client-python/streampipes/model/resource/data_lake_measure.py @@ -17,8 +17,8 @@ from typing import Optional from pydantic import StrictBool, StrictStr -from streampipes_client.model.common import EventSchema -from streampipes_client.model.resource.resource import Resource +from streampipes.model.common import EventSchema +from streampipes.model.resource.resource import Resource __all__ = [ "DataLakeMeasure", diff --git a/streampipes-client-python/streampipes_client/model/resource/data_lake_series.py b/streampipes-client-python/streampipes/model/resource/data_lake_series.py similarity index 98% rename from streampipes-client-python/streampipes_client/model/resource/data_lake_series.py rename to streampipes-client-python/streampipes/model/resource/data_lake_series.py index 60d4d994e2..7d4ab8dc7e 100644 --- a/streampipes-client-python/streampipes_client/model/resource/data_lake_series.py +++ b/streampipes-client-python/streampipes/model/resource/data_lake_series.py @@ -22,7 +22,7 @@ import pandas as pd from pydantic import StrictInt, StrictStr -from streampipes_client.model.resource.resource import Resource +from streampipes.model.resource.resource import Resource __all__ = [ "DataLakeSeries", diff --git a/streampipes-client-python/streampipes_client/model/resource/data_stream.py b/streampipes-client-python/streampipes/model/resource/data_stream.py similarity index 97% rename from streampipes-client-python/streampipes_client/model/resource/data_stream.py rename to streampipes-client-python/streampipes/model/resource/data_stream.py index 2f7a3051d7..99a077419e 100644 --- a/streampipes-client-python/streampipes_client/model/resource/data_stream.py +++ b/streampipes-client-python/streampipes/model/resource/data_stream.py @@ -17,14 +17,14 @@ from typing import List, Optional from pydantic import StrictBool, StrictInt, StrictStr -from streampipes_client.model.common import ( +from streampipes.model.common import ( ApplicationLink, EventGrounding, EventSchema, MeasurementCapability, MeasurementObject, ) -from streampipes_client.model.resource.resource import Resource +from streampipes.model.resource.resource import Resource __all__ = [ "DataStream", diff --git a/streampipes-client-python/streampipes_client/model/resource/function_definition.py b/streampipes-client-python/streampipes/model/resource/function_definition.py similarity index 95% rename from streampipes-client-python/streampipes_client/model/resource/function_definition.py rename to streampipes-client-python/streampipes/model/resource/function_definition.py index 0e0e8d2af6..629eaf748d 100644 --- a/streampipes-client-python/streampipes_client/model/resource/function_definition.py +++ b/streampipes-client-python/streampipes/model/resource/function_definition.py @@ -23,8 +23,8 @@ from uuid import uuid4 from pydantic import Field, StrictInt, StrictStr -from streampipes_client.model.common import BasicModel -from streampipes_client.model.resource.resource import Resource +from streampipes.model.common import BasicModel +from streampipes.model.resource.resource import Resource class FunctionDefinition(Resource): diff --git a/streampipes-client-python/streampipes_client/model/resource/resource.py b/streampipes-client-python/streampipes/model/resource/resource.py similarity index 97% rename from streampipes-client-python/streampipes_client/model/resource/resource.py rename to streampipes-client-python/streampipes/model/resource/resource.py index 1fcf7d2b67..0fef1d6be2 100644 --- a/streampipes-client-python/streampipes_client/model/resource/resource.py +++ b/streampipes-client-python/streampipes/model/resource/resource.py @@ -22,7 +22,7 @@ from abc import ABC, abstractmethod from typing import Dict -from streampipes_client.model.common import BasicModel +from streampipes.model.common import BasicModel __all__ = [ "Resource", diff --git a/streampipes-client-python/tests/client/test_client.py b/streampipes-client-python/tests/client/test_client.py index 0d2f0e61da..8e6b229d50 100644 --- a/streampipes-client-python/tests/client/test_client.py +++ b/streampipes-client-python/tests/client/test_client.py @@ -19,10 +19,10 @@ from unittest import TestCase from unittest.mock import MagicMock, call, patch -from streampipes_client.client import StreamPipesClient -from streampipes_client.client.client_config import StreamPipesClientConfig -from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials -from streampipes_client.endpoint.api import DataLakeMeasureEndpoint +from streampipes.client import StreamPipesClient +from streampipes.client.config import StreamPipesClientConfig +from streampipes.client.credential_provider import StreamPipesApiKeyCredentials +from streampipes.endpoint.api import DataLakeMeasureEndpoint class TestStreamPipesClient(TestCase): @@ -72,7 +72,7 @@ def test_client_create(self): self.assertEqual(result.base_api_path, "https://localhost:443/streampipes-backend/") @patch("builtins.print") - @patch("streampipes_client.endpoint.endpoint.APIEndpoint._make_request", autospec=True) + @patch("streampipes.endpoint.endpoint.APIEndpoint._make_request", autospec=True) def test_client_describe(self, make_request: MagicMock, mocked_print: MagicMock): def simulate_response(*args, **kwargs): Response = namedtuple("Response", ["text"]) diff --git a/streampipes-client-python/tests/client/test_credential_provider.py b/streampipes-client-python/tests/client/test_credential_provider.py index 3660fdfde3..23ed251e68 100644 --- a/streampipes-client-python/tests/client/test_credential_provider.py +++ b/streampipes-client-python/tests/client/test_credential_provider.py @@ -17,7 +17,7 @@ import os from unittest import TestCase -from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials +from streampipes.client.credential_provider import StreamPipesApiKeyCredentials class TestStreamPipesApiKeyCredentials(TestCase): diff --git a/streampipes-client-python/tests/client/test_data_lake_series.py b/streampipes-client-python/tests/client/test_data_lake_series.py index 862b4a1ffb..49b75a90c1 100644 --- a/streampipes-client-python/tests/client/test_data_lake_series.py +++ b/streampipes-client-python/tests/client/test_data_lake_series.py @@ -18,10 +18,10 @@ from unittest import TestCase from unittest.mock import MagicMock, call, patch -from streampipes_client.client import StreamPipesClient -from streampipes_client.client.client_config import StreamPipesClientConfig -from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials -from streampipes_client.model.resource.data_lake_series import ( +from streampipes.client import StreamPipesClient +from streampipes.client.config import StreamPipesClientConfig +from streampipes.client.credential_provider import StreamPipesApiKeyCredentials +from streampipes.model.resource.data_lake_series import ( StreamPipesUnsupportedDataLakeSeries, ) @@ -100,7 +100,7 @@ def setUp(self) -> None: "allDataSeries": [], } - @patch("streampipes_client.client.client.Session", autospec=True) + @patch("streampipes.client.client.Session", autospec=True) def test_to_pandas(self, http_session: MagicMock): http_session_mock = MagicMock() http_session_mock.get.return_value.text = json.dumps(self.series_regular) @@ -138,7 +138,7 @@ def test_to_pandas(self, http_session: MagicMock): ) self.assertEqual(73.37740325927734, result_pd["level"][0]) - @patch("streampipes_client.client.client.Session", autospec=True) + @patch("streampipes.client.client.Session", autospec=True) def test_to_pandas_unsupported_series(self, http_session: MagicMock): http_session_mock = MagicMock() http_session_mock.get.return_value.text = json.dumps(self.series_missing) diff --git a/streampipes-client-python/tests/client/test_endpoint.py b/streampipes-client-python/tests/client/test_endpoint.py index d75946da12..85653ad02d 100644 --- a/streampipes-client-python/tests/client/test_endpoint.py +++ b/streampipes-client-python/tests/client/test_endpoint.py @@ -23,20 +23,20 @@ from pydantic import ValidationError from requests import HTTPError -from streampipes_client.client import StreamPipesClient -from streampipes_client.client.client_config import StreamPipesClientConfig -from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials -from streampipes_client.endpoint.endpoint import ( +from streampipes.client import StreamPipesClient +from streampipes.client.config import StreamPipesClientConfig +from streampipes.client.credential_provider import StreamPipesApiKeyCredentials +from streampipes.endpoint.endpoint import ( MessagingEndpoint, _error_code_to_message, ) -from streampipes_client.endpoint.exceptions import MessagingEndpointNotConfiguredError -from streampipes_client.functions.broker.nats_broker import NatsBroker -from streampipes_client.model.container.resource_container import ( +from streampipes.endpoint.exceptions import MessagingEndpointNotConfiguredError +from streampipes.functions.broker.nats_broker import NatsBroker +from streampipes.model.container.resource_container import ( StreamPipesDataModelError, StreamPipesResourceContainerJSONError, ) -from streampipes_client.model.resource import DataStream +from streampipes.model.resource import DataStream class TestStreamPipesEndpoints(TestCase): @@ -193,7 +193,7 @@ def setUp(self) -> None: self.dlm_all_manipulated[0]["measureName"] = False self.data_lake_measure_all_json_validation = json.dumps(self.dlm_all_manipulated) - @patch("streampipes_client.client.client.Session", autospec=True) + @patch("streampipes.client.client.Session", autospec=True) def test_endpoint_get(self, http_session: MagicMock): http_session_mock = MagicMock() http_session_mock.get.return_value.json.return_value = self.data_stream_get @@ -220,7 +220,7 @@ def test_endpoint_get(self, http_session: MagicMock): self.assertTrue(isinstance(result, DataStream)) self.assertEqual(result.dict(by_alias=True), self.data_stream_get) - @patch("streampipes_client.client.client.Session", autospec=True) + @patch("streampipes.client.client.Session", autospec=True) def test_endpoint_data_stream_happy_path(self, http_session: MagicMock): http_session_mock = MagicMock() http_session_mock.get.return_value.text = self.data_stream_all_json @@ -285,7 +285,7 @@ def test_endpoint_data_stream_happy_path(self, http_session: MagicMock): list(result_pd.columns), ) - @patch("streampipes_client.client.client.Session", autospec=True) + @patch("streampipes.client.client.Session", autospec=True) def test_endpoint_data_lake_measure_happy_path(self, http_session: MagicMock): http_session_mock = MagicMock() http_session_mock.get.return_value.text = self.data_lake_measure_all_json @@ -334,7 +334,7 @@ def test_endpoint_data_lake_measure_happy_path(self, http_session: MagicMock): ) self.assertEqual(2, result_pd["num_event_properties"][0]) - @patch("streampipes_client.client.client.Session", autospec=True) + @patch("streampipes.client.client.Session", autospec=True) def test_endpoint_data_lake_measure_bad_return_code(self, http_session: MagicMock): response_mock = MagicMock() response_mock.status_code = 405 @@ -360,7 +360,7 @@ def test_endpoint_data_lake_measure_bad_return_code(self, http_session: MagicMoc http_error.exception.args[0], ) - @patch("streampipes_client.client.client.Session", autospec=True) + @patch("streampipes.client.client.Session", autospec=True) def test_endpoint_data_lake_measure_json_error(self, http_session: MagicMock): http_session_mock = MagicMock() http_session_mock.get.return_value.text = self.data_lake_measure_all_json_error @@ -376,7 +376,7 @@ def test_endpoint_data_lake_measure_json_error(self, http_session: MagicMock): with self.assertRaises(StreamPipesResourceContainerJSONError): client.dataLakeMeasureApi.all() - @patch("streampipes_client.client.client.Session", autospec=True) + @patch("streampipes.client.client.Session", autospec=True) def test_endpoint_data_lake_measure_validation_error(self, http_session: MagicMock): http_session_mock = MagicMock() http_session_mock.get.return_value.text = self.data_lake_measure_all_json_validation diff --git a/streampipes-client-python/tests/functions/test_function_handler.py b/streampipes-client-python/tests/functions/test_function_handler.py index 3853deb95b..6194d22bbe 100644 --- a/streampipes-client-python/tests/functions/test_function_handler.py +++ b/streampipes-client-python/tests/functions/test_function_handler.py @@ -19,13 +19,13 @@ from unittest import TestCase from unittest.mock import AsyncMock, MagicMock, patch -from streampipes_client.client.client import StreamPipesClient, StreamPipesClientConfig -from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials -from streampipes_client.functions.function_handler import FunctionHandler -from streampipes_client.functions.registration import Registration -from streampipes_client.functions.streampipes_function import StreamPipesFunction -from streampipes_client.functions.utils.function_context import FunctionContext -from streampipes_client.model.resource.data_stream import DataStream +from streampipes.client.client import StreamPipesClient, StreamPipesClientConfig +from streampipes.client.credential_provider import StreamPipesApiKeyCredentials +from streampipes.functions.function_handler import FunctionHandler +from streampipes.functions.registration import Registration +from streampipes.functions.streampipes_function import StreamPipesFunction +from streampipes.functions.utils.function_context import FunctionContext +from streampipes.model.resource.data_stream import DataStream class TestFunction(StreamPipesFunction): @@ -206,11 +206,11 @@ def setUp(self) -> None: {"density": 3.6, "temperature": 30.4, "timestamp": 1670000007000}, ] - @patch("streampipes_client.functions.function_handler.NatsBroker.disconnect", autospec=True) - @patch("streampipes_client.functions.function_handler.NatsBroker._createSubscription", autospec=True) - @patch("streampipes_client.functions.function_handler.NatsBroker._makeConnection", autospec=True) - @patch("streampipes_client.functions.function_handler.NatsBroker.get_message", autospec=True) - @patch("streampipes_client.client.client.Session", autospec=True) + @patch("streampipes.functions.function_handler.NatsBroker.disconnect", autospec=True) + @patch("streampipes.functions.function_handler.NatsBroker._createSubscription", autospec=True) + @patch("streampipes.functions.function_handler.NatsBroker._makeConnection", autospec=True) + @patch("streampipes.functions.function_handler.NatsBroker.get_message", autospec=True) + @patch("streampipes.client.client.Session", autospec=True) def test_function_handler(self, http_session: MagicMock, nats_broker: MagicMock, *args: Tuple[AsyncMock]): http_session_mock = MagicMock() http_session_mock.get.return_value.json.return_value = self.data_stream @@ -241,11 +241,11 @@ def test_function_handler(self, http_session: MagicMock, nats_broker: MagicMock, self.assertListEqual(test_function.data, self.test_stream_data1) self.assertTrue(test_function.stopped) - @patch("streampipes_client.functions.function_handler.NatsBroker.disconnect", autospec=True) - @patch("streampipes_client.functions.function_handler.NatsBroker._createSubscription", autospec=True) - @patch("streampipes_client.functions.function_handler.NatsBroker._makeConnection", autospec=True) - @patch("streampipes_client.functions.function_handler.NatsBroker.get_message", autospec=True) - @patch("streampipes_client.endpoint.endpoint.APIEndpoint.get", autospec=True) + @patch("streampipes.functions.function_handler.NatsBroker.disconnect", autospec=True) + @patch("streampipes.functions.function_handler.NatsBroker._createSubscription", autospec=True) + @patch("streampipes.functions.function_handler.NatsBroker._makeConnection", autospec=True) + @patch("streampipes.functions.function_handler.NatsBroker.get_message", autospec=True) + @patch("streampipes.endpoint.endpoint.APIEndpoint.get", autospec=True) def test_function_handler_two_streams(self, endpoint: MagicMock, nats_broker: MagicMock, *args: Tuple[AsyncMock]): def get_stream(endpoint, stream_id): if stream_id == "urn:streampipes.apache.org:eventstream:uPDKLI":