feldera 0.131.0__py3-none-any.whl → 0.192.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of feldera might be problematic. Click here for more details.
- feldera/__init__.py +2 -2
- feldera/_callback_runner.py +64 -88
- feldera/_helpers.py +8 -2
- feldera/enums.py +145 -92
- feldera/output_handler.py +16 -4
- feldera/pipeline.py +413 -152
- feldera/pipeline_builder.py +15 -8
- feldera/rest/_helpers.py +32 -1
- feldera/rest/_httprequests.py +365 -219
- feldera/rest/config.py +44 -33
- feldera/rest/errors.py +16 -0
- feldera/rest/feldera_client.py +395 -203
- feldera/rest/pipeline.py +15 -0
- feldera/runtime_config.py +4 -0
- feldera/stats.py +4 -1
- feldera/tests/test_datafusionize.py +38 -0
- feldera/testutils.py +382 -0
- feldera/testutils_oidc.py +368 -0
- feldera-0.192.0.dist-info/METADATA +163 -0
- feldera-0.192.0.dist-info/RECORD +26 -0
- feldera-0.131.0.dist-info/METADATA +0 -102
- feldera-0.131.0.dist-info/RECORD +0 -23
- {feldera-0.131.0.dist-info → feldera-0.192.0.dist-info}/WHEEL +0 -0
- {feldera-0.131.0.dist-info → feldera-0.192.0.dist-info}/top_level.txt +0 -0
feldera/pipeline_builder.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import os
|
|
2
2
|
from typing import Optional
|
|
3
3
|
|
|
4
|
+
from feldera.enums import CompilationProfile, PipelineFieldSelector
|
|
5
|
+
from feldera.pipeline import Pipeline
|
|
6
|
+
from feldera.rest.errors import FelderaAPIError
|
|
4
7
|
from feldera.rest.feldera_client import FelderaClient
|
|
5
8
|
from feldera.rest.pipeline import Pipeline as InnerPipeline
|
|
6
|
-
from feldera.pipeline import Pipeline
|
|
7
|
-
from feldera.enums import CompilationProfile
|
|
8
9
|
from feldera.runtime_config import RuntimeConfig
|
|
9
|
-
from feldera.rest.errors import FelderaAPIError
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class PipelineBuilder:
|
|
@@ -49,10 +49,11 @@ class PipelineBuilder:
|
|
|
49
49
|
"FELDERA_RUNTIME_VERSION", runtime_version
|
|
50
50
|
)
|
|
51
51
|
|
|
52
|
-
def create(self) -> Pipeline:
|
|
52
|
+
def create(self, wait: bool = True) -> Pipeline:
|
|
53
53
|
"""
|
|
54
54
|
Create the pipeline if it does not exist.
|
|
55
55
|
|
|
56
|
+
:param wait: Whether to wait for the pipeline to be created. True by default
|
|
56
57
|
:return: The created pipeline
|
|
57
58
|
"""
|
|
58
59
|
|
|
@@ -60,7 +61,10 @@ class PipelineBuilder:
|
|
|
60
61
|
raise ValueError("Name and SQL are required to create a pipeline")
|
|
61
62
|
|
|
62
63
|
try:
|
|
63
|
-
if
|
|
64
|
+
if (
|
|
65
|
+
self.client.get_pipeline(self.name, PipelineFieldSelector.STATUS)
|
|
66
|
+
is not None
|
|
67
|
+
):
|
|
64
68
|
raise RuntimeError(f"Pipeline with name {self.name} already exists")
|
|
65
69
|
except FelderaAPIError as err:
|
|
66
70
|
if err.error_code != "UnknownPipelineName":
|
|
@@ -79,17 +83,20 @@ class PipelineBuilder:
|
|
|
79
83
|
runtime_config=self.runtime_config.to_dict(),
|
|
80
84
|
)
|
|
81
85
|
|
|
82
|
-
inner = self.client.create_pipeline(inner)
|
|
86
|
+
inner = self.client.create_pipeline(inner, wait=wait)
|
|
83
87
|
pipeline = Pipeline(self.client)
|
|
84
88
|
pipeline._inner = inner
|
|
85
89
|
|
|
86
90
|
return pipeline
|
|
87
91
|
|
|
88
|
-
def create_or_replace(self) -> Pipeline:
|
|
92
|
+
def create_or_replace(self, wait: bool = True) -> Pipeline:
|
|
89
93
|
"""
|
|
90
94
|
Creates a pipeline if it does not exist and replaces it if it exists.
|
|
91
95
|
|
|
92
96
|
If the pipeline exists and is running, it will be stopped and replaced.
|
|
97
|
+
|
|
98
|
+
:param wait: Whether to wait for the pipeline to be created. True by default
|
|
99
|
+
:return: The created pipeline
|
|
93
100
|
"""
|
|
94
101
|
|
|
95
102
|
if self.name is None or self.sql is None:
|
|
@@ -118,7 +125,7 @@ class PipelineBuilder:
|
|
|
118
125
|
runtime_config=self.runtime_config.to_dict(),
|
|
119
126
|
)
|
|
120
127
|
|
|
121
|
-
inner = self.client.create_or_update_pipeline(inner)
|
|
128
|
+
inner = self.client.create_or_update_pipeline(inner, wait=wait)
|
|
122
129
|
pipeline = Pipeline(self.client)
|
|
123
130
|
pipeline._inner = inner
|
|
124
131
|
|
feldera/rest/_helpers.py
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import logging
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def determine_client_version() -> str:
|
|
2
6
|
from importlib.metadata import version, PackageNotFoundError
|
|
3
7
|
|
|
4
8
|
try:
|
|
@@ -7,3 +11,30 @@ def client_version() -> str:
|
|
|
7
11
|
version = "unknown"
|
|
8
12
|
|
|
9
13
|
return version
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def requests_verify_from_env() -> str | bool:
|
|
17
|
+
env_feldera_tls_insecure = os.environ.get("FELDERA_TLS_INSECURE")
|
|
18
|
+
FELDERA_HTTPS_TLS_CERT = os.environ.get("FELDERA_HTTPS_TLS_CERT")
|
|
19
|
+
|
|
20
|
+
if env_feldera_tls_insecure is not None and FELDERA_HTTPS_TLS_CERT is not None:
|
|
21
|
+
logging.warning(
|
|
22
|
+
"environment variables FELDERA_HTTPS_TLS_CERT and "
|
|
23
|
+
+ "FELDERA_TLS_INSECURE both are set."
|
|
24
|
+
+ "\nFELDERA_HTTPS_TLS_CERT takes priority."
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
if env_feldera_tls_insecure is None:
|
|
28
|
+
feldera_tls_insecure = False
|
|
29
|
+
else:
|
|
30
|
+
feldera_tls_insecure = env_feldera_tls_insecure.strip().lower() in (
|
|
31
|
+
"1",
|
|
32
|
+
"true",
|
|
33
|
+
"yes",
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
requests_verify = not feldera_tls_insecure
|
|
37
|
+
if FELDERA_HTTPS_TLS_CERT is not None:
|
|
38
|
+
requests_verify = FELDERA_HTTPS_TLS_CERT
|
|
39
|
+
|
|
40
|
+
return requests_verify
|