feldera 0.108.0__tar.gz → 0.110.0__tar.gz

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.

Files changed (32) hide show
  1. {feldera-0.108.0 → feldera-0.110.0}/PKG-INFO +1 -1
  2. {feldera-0.108.0 → feldera-0.110.0}/feldera/pipeline.py +20 -2
  3. {feldera-0.108.0 → feldera-0.110.0}/feldera/pipeline_builder.py +10 -6
  4. {feldera-0.108.0 → feldera-0.110.0}/feldera/rest/feldera_client.py +20 -6
  5. {feldera-0.108.0 → feldera-0.110.0}/feldera/runtime_config.py +10 -9
  6. {feldera-0.108.0 → feldera-0.110.0}/feldera.egg-info/PKG-INFO +1 -1
  7. {feldera-0.108.0 → feldera-0.110.0}/pyproject.toml +1 -1
  8. {feldera-0.108.0 → feldera-0.110.0}/README.md +0 -0
  9. {feldera-0.108.0 → feldera-0.110.0}/feldera/__init__.py +0 -0
  10. {feldera-0.108.0 → feldera-0.110.0}/feldera/_callback_runner.py +0 -0
  11. {feldera-0.108.0 → feldera-0.110.0}/feldera/_helpers.py +0 -0
  12. {feldera-0.108.0 → feldera-0.110.0}/feldera/enums.py +0 -0
  13. {feldera-0.108.0 → feldera-0.110.0}/feldera/output_handler.py +0 -0
  14. {feldera-0.108.0 → feldera-0.110.0}/feldera/rest/__init__.py +0 -0
  15. {feldera-0.108.0 → feldera-0.110.0}/feldera/rest/_helpers.py +0 -0
  16. {feldera-0.108.0 → feldera-0.110.0}/feldera/rest/_httprequests.py +0 -0
  17. {feldera-0.108.0 → feldera-0.110.0}/feldera/rest/config.py +0 -0
  18. {feldera-0.108.0 → feldera-0.110.0}/feldera/rest/errors.py +0 -0
  19. {feldera-0.108.0 → feldera-0.110.0}/feldera/rest/feldera_config.py +0 -0
  20. {feldera-0.108.0 → feldera-0.110.0}/feldera/rest/pipeline.py +0 -0
  21. {feldera-0.108.0 → feldera-0.110.0}/feldera/rest/sql_table.py +0 -0
  22. {feldera-0.108.0 → feldera-0.110.0}/feldera/rest/sql_view.py +0 -0
  23. {feldera-0.108.0 → feldera-0.110.0}/feldera/stats.py +0 -0
  24. {feldera-0.108.0 → feldera-0.110.0}/feldera.egg-info/SOURCES.txt +0 -0
  25. {feldera-0.108.0 → feldera-0.110.0}/feldera.egg-info/dependency_links.txt +0 -0
  26. {feldera-0.108.0 → feldera-0.110.0}/feldera.egg-info/requires.txt +0 -0
  27. {feldera-0.108.0 → feldera-0.110.0}/feldera.egg-info/top_level.txt +0 -0
  28. {feldera-0.108.0 → feldera-0.110.0}/setup.cfg +0 -0
  29. {feldera-0.108.0 → feldera-0.110.0}/tests/test_pipeline_builder.py +0 -0
  30. {feldera-0.108.0 → feldera-0.110.0}/tests/test_shared_pipeline0.py +0 -0
  31. {feldera-0.108.0 → feldera-0.110.0}/tests/test_shared_pipeline1.py +0 -0
  32. {feldera-0.108.0 → feldera-0.110.0}/tests/test_udf.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: feldera
3
- Version: 0.108.0
3
+ Version: 0.110.0
4
4
  Summary: The feldera python client
5
5
  Author-email: Feldera Team <dev@feldera.com>
6
6
  License: MIT
@@ -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) -> Mapping[str, Any]:
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
  """
@@ -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=dict(
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=dict(
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)
@@ -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(self, name: str, sql: str):
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 the pipeline SQL
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={"program_code": sql},
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):
@@ -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 isinstance(storage, bool):
105
- self.storage = storage
106
- if isinstance(storage, Storage):
107
- self.storage = storage.__dict__
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: feldera
3
- Version: 0.108.0
3
+ Version: 0.110.0
4
4
  Summary: The feldera python client
5
5
  Author-email: Feldera Team <dev@feldera.com>
6
6
  License: MIT
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
  name = "feldera"
7
7
  readme = "README.md"
8
8
  description = "The feldera python client"
9
- version = "0.108.0"
9
+ version = "0.110.0"
10
10
  license = { text = "MIT" }
11
11
  requires-python = ">=3.10"
12
12
  authors = [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes