feldera 0.107.0__py3-none-any.whl → 0.109.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 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) -> 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
  """
@@ -68,9 +68,7 @@ class PipelineBuilder:
68
68
  program_config={
69
69
  "profile": self.compilation_profile.value,
70
70
  },
71
- runtime_config=dict(
72
- (k, v) for k, v in self.runtime_config.__dict__.items() if v is not None
73
- ),
71
+ runtime_config=self.runtime_config.to_dict(),
74
72
  )
75
73
 
76
74
  inner = self.client.create_pipeline(inner)
@@ -108,9 +106,7 @@ class PipelineBuilder:
108
106
  program_config={
109
107
  "profile": self.compilation_profile.value,
110
108
  },
111
- runtime_config=dict(
112
- (k, v) for k, v in self.runtime_config.__dict__.items() if v is not None
113
- ),
109
+ runtime_config=self.runtime_config.to_dict(),
114
110
  )
115
111
 
116
112
  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):
feldera/runtime_config.py CHANGED
@@ -101,10 +101,13 @@ class RuntimeConfig:
101
101
  }
102
102
  if resources is not None:
103
103
  self.resources = resources.__dict__
104
- if isinstance(storage, bool):
105
- self.storage = storage
106
- if isinstance(storage, Storage):
107
- self.storage = storage.__dict__
104
+ if storage is not None:
105
+ if isinstance(storage, bool):
106
+ self.storage = storage
107
+ elif isinstance(storage, Storage):
108
+ self.storage = storage.__dict__
109
+ else:
110
+ raise ValueError(f"Unknown value '{storage}' for storage")
108
111
 
109
112
  @staticmethod
110
113
  def default() -> "RuntimeConfig":
@@ -119,3 +122,6 @@ class RuntimeConfig:
119
122
  conf = cls()
120
123
  conf.__dict__ = d
121
124
  return conf
125
+
126
+ def to_dict(self) -> dict:
127
+ 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.107.0
3
+ Version: 0.109.0
4
4
  Summary: The feldera python client
5
5
  Author-email: Feldera Team <dev@feldera.com>
6
6
  License: MIT
@@ -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=6v87x_knsTlCEkflc5M-toSpHdhNGAfKQROjyY5neWk,34451
7
- feldera/pipeline_builder.py,sha256=pK8t93PIyM3zHzVTNg2jAafI7g2ZThNQyZER-_6e3G0,4081
8
- feldera/runtime_config.py,sha256=rPO1abLSJmozR4z1QwI93kt1rZMkFq-CBdqqmpKCSMU,4369
6
+ feldera/pipeline.py,sha256=fRtGWYzxZOm6Z93bDjpU68EZ_uDTMdwPL-r-o7EXPTE,35135
7
+ feldera/pipeline_builder.py,sha256=D3SRLzTiaikiXD-w3PKfI8zIaIzb2ycDMrJFh-ctybE,3923
8
+ feldera/runtime_config.py,sha256=N8btJuvIuzbrQMnVjEmSX9WGgcpb3-DMGUYl7sjXQEY,4623
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=Aic8PvBMG_aP_7d1qKx2C3RZ44rwLXN-OjvtV-a_dE8,25275
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.107.0.dist-info/METADATA,sha256=EgDvGH_nS4OnTUllk5w67J2JpGWVJl5vs3fu7KKVcM0,4101
21
- feldera-0.107.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
- feldera-0.107.0.dist-info/top_level.txt,sha256=fB6yTqrQiO6RCbY1xP2T_mpPoTjDFtJvkJJodiee7d0,8
23
- feldera-0.107.0.dist-info/RECORD,,
20
+ feldera-0.109.0.dist-info/METADATA,sha256=hHb2gLvXgw6nHJt6bnWdK654DpYcaijLMEBv75YTohw,4101
21
+ feldera-0.109.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
+ feldera-0.109.0.dist-info/top_level.txt,sha256=fB6yTqrQiO6RCbY1xP2T_mpPoTjDFtJvkJJodiee7d0,8
23
+ feldera-0.109.0.dist-info/RECORD,,