feldera 0.108.0__py3-none-any.whl → 0.110.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/pipeline.py +20 -2
- feldera/pipeline_builder.py +10 -6
- feldera/rest/feldera_client.py +20 -6
- feldera/runtime_config.py +10 -9
- {feldera-0.108.0.dist-info → feldera-0.110.0.dist-info}/METADATA +1 -1
- {feldera-0.108.0.dist-info → feldera-0.110.0.dist-info}/RECORD +8 -8
- {feldera-0.108.0.dist-info → feldera-0.110.0.dist-info}/WHEEL +0 -0
- {feldera-0.108.0.dist-info → feldera-0.110.0.dist-info}/top_level.txt +0 -0
feldera/pipeline.py
CHANGED
|
@@ -19,6 +19,7 @@ from feldera.output_handler import OutputHandler
|
|
|
19
19
|
from feldera._helpers import ensure_dataframe_has_columns, chunk_dataframe
|
|
20
20
|
from feldera.rest.sql_table import SQLTable
|
|
21
21
|
from feldera.rest.sql_view import SQLView
|
|
22
|
+
from feldera.runtime_config import RuntimeConfig
|
|
22
23
|
from feldera.stats import PipelineStatistics
|
|
23
24
|
|
|
24
25
|
|
|
@@ -827,13 +828,30 @@ pipeline '{self.name}' to sync checkpoint '{uuid}'"""
|
|
|
827
828
|
self.refresh()
|
|
828
829
|
return self._inner.program_config
|
|
829
830
|
|
|
830
|
-
def runtime_config(self) ->
|
|
831
|
+
def runtime_config(self) -> RuntimeConfig:
|
|
831
832
|
"""
|
|
832
833
|
Return the runtime config of the pipeline.
|
|
833
834
|
"""
|
|
834
835
|
|
|
835
836
|
self.refresh()
|
|
836
|
-
return self._inner.runtime_config
|
|
837
|
+
return RuntimeConfig.from_dict(self._inner.runtime_config)
|
|
838
|
+
|
|
839
|
+
def set_runtime_config(self, runtime_config: RuntimeConfig):
|
|
840
|
+
"""Updates the runtime config of the pipeline. The pipeline
|
|
841
|
+
must be stopped and, in addition, changing some pipeline
|
|
842
|
+
configuration requires storage to be cleared.
|
|
843
|
+
|
|
844
|
+
For example, to set 'min_batch_size_records' on a pipeline:
|
|
845
|
+
|
|
846
|
+
runtime_config = pipeline.runtime_config()
|
|
847
|
+
runtime_config.min_batch_size_records = 500
|
|
848
|
+
pipeline.set_runtime_config(runtime_config)
|
|
849
|
+
|
|
850
|
+
"""
|
|
851
|
+
|
|
852
|
+
self.client.patch_pipeline(
|
|
853
|
+
name=self._inner.name, runtime_config=runtime_config.to_dict()
|
|
854
|
+
)
|
|
837
855
|
|
|
838
856
|
def id(self) -> str:
|
|
839
857
|
"""
|
feldera/pipeline_builder.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
1
4
|
from feldera.rest.feldera_client import FelderaClient
|
|
2
5
|
from feldera.rest.pipeline import Pipeline as InnerPipeline
|
|
3
6
|
from feldera.pipeline import Pipeline
|
|
@@ -32,6 +35,7 @@ class PipelineBuilder:
|
|
|
32
35
|
description: str = "",
|
|
33
36
|
compilation_profile: CompilationProfile = CompilationProfile.OPTIMIZED,
|
|
34
37
|
runtime_config: RuntimeConfig = RuntimeConfig.default(),
|
|
38
|
+
runtime_version: Optional[str] = None,
|
|
35
39
|
):
|
|
36
40
|
self.client: FelderaClient = client
|
|
37
41
|
self.name: str | None = name
|
|
@@ -41,6 +45,9 @@ class PipelineBuilder:
|
|
|
41
45
|
self.udf_toml: str = udf_toml
|
|
42
46
|
self.compilation_profile: CompilationProfile = compilation_profile
|
|
43
47
|
self.runtime_config: RuntimeConfig = runtime_config
|
|
48
|
+
self.runtime_version: Optional[str] = runtime_version or os.environ.get(
|
|
49
|
+
"FELDERA_RUNTIME_VERSION"
|
|
50
|
+
)
|
|
44
51
|
|
|
45
52
|
def create(self) -> Pipeline:
|
|
46
53
|
"""
|
|
@@ -67,10 +74,9 @@ class PipelineBuilder:
|
|
|
67
74
|
udf_toml=self.udf_toml,
|
|
68
75
|
program_config={
|
|
69
76
|
"profile": self.compilation_profile.value,
|
|
77
|
+
"runtime_version": self.runtime_version,
|
|
70
78
|
},
|
|
71
|
-
runtime_config=
|
|
72
|
-
(k, v) for k, v in self.runtime_config.__dict__.items() if v is not None
|
|
73
|
-
),
|
|
79
|
+
runtime_config=self.runtime_config.to_dict(),
|
|
74
80
|
)
|
|
75
81
|
|
|
76
82
|
inner = self.client.create_pipeline(inner)
|
|
@@ -108,9 +114,7 @@ class PipelineBuilder:
|
|
|
108
114
|
program_config={
|
|
109
115
|
"profile": self.compilation_profile.value,
|
|
110
116
|
},
|
|
111
|
-
runtime_config=
|
|
112
|
-
(k, v) for k, v in self.runtime_config.__dict__.items() if v is not None
|
|
113
|
-
),
|
|
117
|
+
runtime_config=self.runtime_config.to_dict(),
|
|
114
118
|
)
|
|
115
119
|
|
|
116
120
|
inner = self.client.create_or_update_pipeline(inner)
|
feldera/rest/feldera_client.py
CHANGED
|
@@ -4,7 +4,7 @@ import logging
|
|
|
4
4
|
import time
|
|
5
5
|
import json
|
|
6
6
|
from decimal import Decimal
|
|
7
|
-
from typing import Generator
|
|
7
|
+
from typing import Generator, Mapping
|
|
8
8
|
|
|
9
9
|
from feldera.rest.config import Config
|
|
10
10
|
from feldera.rest.feldera_config import FelderaConfig
|
|
@@ -191,18 +191,32 @@ class FelderaClient:
|
|
|
191
191
|
|
|
192
192
|
return self.__wait_for_compilation(pipeline.name)
|
|
193
193
|
|
|
194
|
-
def patch_pipeline(
|
|
194
|
+
def patch_pipeline(
|
|
195
|
+
self,
|
|
196
|
+
name: str,
|
|
197
|
+
sql: Optional[str] = None,
|
|
198
|
+
udf_rust: Optional[str] = None,
|
|
199
|
+
udf_toml: Optional[str] = None,
|
|
200
|
+
program_config: Optional[Mapping[str, Any]] = None,
|
|
201
|
+
runtime_config: Optional[Mapping[str, Any]] = None,
|
|
202
|
+
description: Optional[str] = None,
|
|
203
|
+
):
|
|
195
204
|
"""
|
|
196
|
-
Incrementally update
|
|
205
|
+
Incrementally update pipeline
|
|
197
206
|
|
|
198
207
|
:param name: The name of the pipeline
|
|
199
|
-
:param sql: The SQL snippet. Replaces the existing SQL code with this
|
|
200
|
-
one.
|
|
201
208
|
"""
|
|
202
209
|
|
|
203
210
|
self.http.patch(
|
|
204
211
|
path=f"/pipelines/{name}",
|
|
205
|
-
body={
|
|
212
|
+
body={
|
|
213
|
+
"program_code": sql,
|
|
214
|
+
"udf_rust": udf_rust,
|
|
215
|
+
"udf_toml": udf_toml,
|
|
216
|
+
"program_config": program_config,
|
|
217
|
+
"runtime_config": runtime_config,
|
|
218
|
+
"description": description,
|
|
219
|
+
},
|
|
206
220
|
)
|
|
207
221
|
|
|
208
222
|
def delete_pipeline(self, name: str):
|
feldera/runtime_config.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import os
|
|
2
1
|
from typing import Optional, Any, Mapping
|
|
3
2
|
from feldera.enums import FaultToleranceModel
|
|
4
3
|
|
|
@@ -79,7 +78,6 @@ class RuntimeConfig:
|
|
|
79
78
|
clock_resolution_usecs: Optional[int] = None,
|
|
80
79
|
provisioning_timeout_secs: Optional[int] = None,
|
|
81
80
|
resources: Optional[Resources] = None,
|
|
82
|
-
runtime_version: Optional[str] = None,
|
|
83
81
|
fault_tolerance_model: Optional[FaultToleranceModel] = None,
|
|
84
82
|
checkpoint_interval_secs: Optional[int] = None,
|
|
85
83
|
):
|
|
@@ -91,9 +89,6 @@ class RuntimeConfig:
|
|
|
91
89
|
self.min_batch_size_records = min_batch_size_records
|
|
92
90
|
self.clock_resolution_usecs = clock_resolution_usecs
|
|
93
91
|
self.provisioning_timeout_secs = provisioning_timeout_secs
|
|
94
|
-
self.runtime_version = runtime_version or os.environ.get(
|
|
95
|
-
"FELDERA_RUNTIME_VERSION"
|
|
96
|
-
)
|
|
97
92
|
if fault_tolerance_model is not None:
|
|
98
93
|
self.fault_tolerance = {
|
|
99
94
|
"model": str(fault_tolerance_model),
|
|
@@ -101,10 +96,13 @@ class RuntimeConfig:
|
|
|
101
96
|
}
|
|
102
97
|
if resources is not None:
|
|
103
98
|
self.resources = resources.__dict__
|
|
104
|
-
if
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
99
|
+
if storage is not None:
|
|
100
|
+
if isinstance(storage, bool):
|
|
101
|
+
self.storage = storage
|
|
102
|
+
elif isinstance(storage, Storage):
|
|
103
|
+
self.storage = storage.__dict__
|
|
104
|
+
else:
|
|
105
|
+
raise ValueError(f"Unknown value '{storage}' for storage")
|
|
108
106
|
|
|
109
107
|
@staticmethod
|
|
110
108
|
def default() -> "RuntimeConfig":
|
|
@@ -119,3 +117,6 @@ class RuntimeConfig:
|
|
|
119
117
|
conf = cls()
|
|
120
118
|
conf.__dict__ = d
|
|
121
119
|
return conf
|
|
120
|
+
|
|
121
|
+
def to_dict(self) -> dict:
|
|
122
|
+
return dict((k, v) for k, v in self.__dict__.items() if v is not None)
|
|
@@ -3,21 +3,21 @@ feldera/_callback_runner.py,sha256=GNOg3TrKJg9zJU0HvpWxCHqzjMUX8ORiHhtiEEdVQzE,4
|
|
|
3
3
|
feldera/_helpers.py,sha256=rN0WuGSCCQlXWFMimZUQrgs-LJAfUo074d79sLElncQ,3023
|
|
4
4
|
feldera/enums.py,sha256=MTHBojVANsdRnjbrzCyIOniDIUaH8nTYRfxB7QvajEE,9570
|
|
5
5
|
feldera/output_handler.py,sha256=64J3ljhOaKIhxdjOKYi-BUz_HnMwROfmN8eE-btYygU,1930
|
|
6
|
-
feldera/pipeline.py,sha256=
|
|
7
|
-
feldera/pipeline_builder.py,sha256=
|
|
8
|
-
feldera/runtime_config.py,sha256=
|
|
6
|
+
feldera/pipeline.py,sha256=fRtGWYzxZOm6Z93bDjpU68EZ_uDTMdwPL-r-o7EXPTE,35135
|
|
7
|
+
feldera/pipeline_builder.py,sha256=25tncJd-qiuHWZOezU34oGfDJqFAdjBEMd9QipNfswc,4195
|
|
8
|
+
feldera/runtime_config.py,sha256=MuYJPd5G_hnu_eDz4ge4BfYvSBSOvOEtv4NYh5sEwqU,4452
|
|
9
9
|
feldera/stats.py,sha256=XBhkRsV7FXErwWuPP0i3q9W77mzkMo-oThPVEZy5y3U,5028
|
|
10
10
|
feldera/rest/__init__.py,sha256=Eg-EKUU3RSTDcdxTR_7wNDnCly8VpXEzsZCQUmf-y2M,308
|
|
11
11
|
feldera/rest/_helpers.py,sha256=q7jWInKp9IiIli8N5o31lDG3hNUbcsJqufZXYHG04ps,222
|
|
12
12
|
feldera/rest/_httprequests.py,sha256=e22YbpzOzy7MGo7hk9MOU7ZRTj3F314grY0Ygr-_goI,6636
|
|
13
13
|
feldera/rest/config.py,sha256=DYzZKngDEhouTEwqVFd-rDrBN9tWqsU07Jl_BTT4mXs,1008
|
|
14
14
|
feldera/rest/errors.py,sha256=b4i2JjrbSmej7jdko_FL8UeXklLKenSipwMT80jowaM,1720
|
|
15
|
-
feldera/rest/feldera_client.py,sha256=
|
|
15
|
+
feldera/rest/feldera_client.py,sha256=b85YS7gbxpCu5OHK34TDlB96vnt-HYVXY65WeWroDJY,25737
|
|
16
16
|
feldera/rest/feldera_config.py,sha256=1pnGbLFMSLvp7Qh_OlPLALSKCSHIktNWKvx6gYU00U4,1374
|
|
17
17
|
feldera/rest/pipeline.py,sha256=-dGGUdtHMABKrQEclaeuwGI_FOCrQOk6p2aCFV0FdU8,2890
|
|
18
18
|
feldera/rest/sql_table.py,sha256=qrw-YwMzx5T81zDefNO1KOx7EyypFz1vPwGBzSUB7kc,652
|
|
19
19
|
feldera/rest/sql_view.py,sha256=hN12mPM0mvwLCIPYywpb12s9Hd2Ws31IlTMXPriMisw,644
|
|
20
|
-
feldera-0.
|
|
21
|
-
feldera-0.
|
|
22
|
-
feldera-0.
|
|
23
|
-
feldera-0.
|
|
20
|
+
feldera-0.110.0.dist-info/METADATA,sha256=N93J-gZZsEyKYrckWeOEkhSQQYKQPc5xta5ltiFdCwk,4101
|
|
21
|
+
feldera-0.110.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
22
|
+
feldera-0.110.0.dist-info/top_level.txt,sha256=fB6yTqrQiO6RCbY1xP2T_mpPoTjDFtJvkJJodiee7d0,8
|
|
23
|
+
feldera-0.110.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|