feldera 0.101.0__tar.gz → 0.102.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.101.0 → feldera-0.102.0}/PKG-INFO +1 -1
  2. {feldera-0.101.0 → feldera-0.102.0}/feldera/enums.py +35 -0
  3. {feldera-0.101.0 → feldera-0.102.0}/feldera/pipeline.py +5 -7
  4. {feldera-0.101.0 → feldera-0.102.0}/feldera/pipeline_builder.py +5 -3
  5. {feldera-0.101.0 → feldera-0.102.0}/feldera/rest/feldera_client.py +1 -1
  6. {feldera-0.101.0 → feldera-0.102.0}/feldera/runtime_config.py +14 -1
  7. {feldera-0.101.0 → feldera-0.102.0}/feldera.egg-info/PKG-INFO +1 -1
  8. {feldera-0.101.0 → feldera-0.102.0}/pyproject.toml +1 -1
  9. {feldera-0.101.0 → feldera-0.102.0}/README.md +0 -0
  10. {feldera-0.101.0 → feldera-0.102.0}/feldera/__init__.py +0 -0
  11. {feldera-0.101.0 → feldera-0.102.0}/feldera/_callback_runner.py +0 -0
  12. {feldera-0.101.0 → feldera-0.102.0}/feldera/_helpers.py +0 -0
  13. {feldera-0.101.0 → feldera-0.102.0}/feldera/output_handler.py +0 -0
  14. {feldera-0.101.0 → feldera-0.102.0}/feldera/rest/__init__.py +0 -0
  15. {feldera-0.101.0 → feldera-0.102.0}/feldera/rest/_helpers.py +0 -0
  16. {feldera-0.101.0 → feldera-0.102.0}/feldera/rest/_httprequests.py +0 -0
  17. {feldera-0.101.0 → feldera-0.102.0}/feldera/rest/config.py +0 -0
  18. {feldera-0.101.0 → feldera-0.102.0}/feldera/rest/errors.py +0 -0
  19. {feldera-0.101.0 → feldera-0.102.0}/feldera/rest/feldera_config.py +0 -0
  20. {feldera-0.101.0 → feldera-0.102.0}/feldera/rest/pipeline.py +0 -0
  21. {feldera-0.101.0 → feldera-0.102.0}/feldera/rest/sql_table.py +0 -0
  22. {feldera-0.101.0 → feldera-0.102.0}/feldera/rest/sql_view.py +0 -0
  23. {feldera-0.101.0 → feldera-0.102.0}/feldera/stats.py +0 -0
  24. {feldera-0.101.0 → feldera-0.102.0}/feldera.egg-info/SOURCES.txt +0 -0
  25. {feldera-0.101.0 → feldera-0.102.0}/feldera.egg-info/dependency_links.txt +0 -0
  26. {feldera-0.101.0 → feldera-0.102.0}/feldera.egg-info/requires.txt +0 -0
  27. {feldera-0.101.0 → feldera-0.102.0}/feldera.egg-info/top_level.txt +0 -0
  28. {feldera-0.101.0 → feldera-0.102.0}/setup.cfg +0 -0
  29. {feldera-0.101.0 → feldera-0.102.0}/tests/test_pipeline_builder.py +0 -0
  30. {feldera-0.101.0 → feldera-0.102.0}/tests/test_shared_pipeline0.py +0 -0
  31. {feldera-0.101.0 → feldera-0.102.0}/tests/test_shared_pipeline1.py +0 -0
  32. {feldera-0.101.0 → feldera-0.102.0}/tests/test_udf.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: feldera
3
- Version: 0.101.0
3
+ Version: 0.102.0
4
4
  Summary: The feldera python client
5
5
  Author-email: Feldera Team <dev@feldera.com>
6
6
  License: MIT
@@ -276,3 +276,38 @@ class StorageStatus(Enum):
276
276
 
277
277
  def __eq__(self, other):
278
278
  return self.value == other.value
279
+
280
+
281
+ class FaultToleranceModel(Enum):
282
+ """
283
+ The fault tolerance model.
284
+ """
285
+
286
+ AtLeastOnce = 1
287
+ """
288
+ Each record is output at least once. Crashes may duplicate output, but
289
+ no input or output is dropped.
290
+ """
291
+
292
+ ExactlyOnce = 2
293
+ """
294
+ Each record is output exactly once. Crashes do not drop or duplicate
295
+ input or output.
296
+ """
297
+
298
+ def __str__(self) -> str:
299
+ match self:
300
+ case FaultToleranceModel.AtLeastOnce:
301
+ return "at_least_once"
302
+ case FaultToleranceModel.ExactlyOnce:
303
+ return "exactly_once"
304
+
305
+ @staticmethod
306
+ def from_str(value):
307
+ for member in FaultToleranceModel:
308
+ if str(member) == value.lower():
309
+ return member
310
+
311
+ raise ValueError(
312
+ f"Unknown value '{value}' for enum {FaultToleranceModel.__name__}"
313
+ )
@@ -145,7 +145,7 @@ class Pipeline:
145
145
  :param data: The JSON encoded data to be pushed to the pipeline. The data should be in the form:
146
146
  `{'col1': 'val1', 'col2': 'val2'}` or `[{'col1': 'val1', 'col2': 'val2'}, {'col1': 'val1', 'col2': 'val2'}]`
147
147
  :param update_format: The update format of the JSON data to be pushed to the pipeline. Must be one of:
148
- "raw", "insert_delete". <https://docs.feldera.com/formats/json#the-insertdelete-format>
148
+ "raw", "insert_delete". https://docs.feldera.com/formats/json#the-insertdelete-format
149
149
  :param force: `True` to push data even if the pipeline is paused. `False` by default.
150
150
 
151
151
  :raises ValueError: If the update format is invalid.
@@ -180,7 +180,7 @@ class Pipeline:
180
180
  All connectors are RUNNING by default.
181
181
 
182
182
  Refer to the connector documentation for more information:
183
- <https://docs.feldera.com/connectors/#input-connector-orchestration>
183
+ https://docs.feldera.com/connectors/#input-connector-orchestration
184
184
 
185
185
  :param table_name: The name of the table that the connector is attached to.
186
186
  :param connector_name: The name of the connector to pause.
@@ -199,7 +199,7 @@ class Pipeline:
199
199
  All connectors are RUNNING by default.
200
200
 
201
201
  Refer to the connector documentation for more information:
202
- <https://docs.feldera.com/connectors/#input-connector-orchestration>
202
+ https://docs.feldera.com/connectors/#input-connector-orchestration
203
203
 
204
204
  :param table_name: The name of the table that the connector is attached to.
205
205
  :param connector_name: The name of the connector to resume.
@@ -533,15 +533,13 @@ metrics"""
533
533
 
534
534
  def checkpoint(self, wait: bool = False, timeout_s=300) -> int:
535
535
  """
536
- Checkpoints this pipeline, if fault-tolerance is enabled.
537
- Fault Tolerance in Feldera:
538
- <https://docs.feldera.com/pipelines/fault-tolerance/>
536
+ Checkpoints this pipeline.
539
537
 
540
538
  :param wait: If true, will block until the checkpoint completes.
541
539
  :param timeout_s: The maximum time (in seconds) to wait for the
542
540
  checkpoint to complete.
543
541
 
544
- :raises FelderaAPIError: If checkpointing is not enabled.
542
+ :raises FelderaAPIError: If enterprise features are not enabled.
545
543
  """
546
544
 
547
545
  seq = self.client.checkpoint_pipeline(self.name)
@@ -10,14 +10,16 @@ class PipelineBuilder:
10
10
  """
11
11
  A builder for creating a Feldera Pipeline.
12
12
 
13
- :param client: The `.FelderaClient` instance
13
+ :param client: The :class:`.FelderaClient` instance
14
14
  :param name: The name of the pipeline
15
15
  :param description: The description of the pipeline
16
16
  :param sql: The SQL code of the pipeline
17
17
  :param udf_rust: Rust code for UDFs
18
18
  :param udf_toml: Rust dependencies required by UDFs (in the TOML format)
19
- :param compilation_profile: The compilation profile to use
20
- :param runtime_config: The runtime config to use
19
+ :param compilation_profile: The :class:`.CompilationProfile` to use
20
+ :param runtime_config: The :class:`.RuntimeConfig` to use. Enables
21
+ configuring the runtime behavior of the pipeline such as:
22
+ fault tolerance, storage and :class:`.Resources`
21
23
  """
22
24
 
23
25
  def __init__(
@@ -404,7 +404,7 @@ Reason: The pipeline is in a STOPPED state due to the following error:
404
404
 
405
405
  def checkpoint_pipeline(self, pipeline_name: str) -> int:
406
406
  """
407
- Checkpoint a fault-tolerant pipeline
407
+ Checkpoint a pipeline.
408
408
 
409
409
  :param pipeline_name: The name of the pipeline to checkpoint
410
410
  """
@@ -1,5 +1,6 @@
1
1
  import os
2
2
  from typing import Optional, Any, Mapping
3
+ from feldera.enums import FaultToleranceModel
3
4
 
4
5
 
5
6
  class Resources:
@@ -59,6 +60,11 @@ class Storage:
59
60
  class RuntimeConfig:
60
61
  """
61
62
  Runtime configuration class to define the configuration for a pipeline.
63
+ To create runtime config from a dictionary, use
64
+ :meth:`.RuntimeConfig.from_dict`.
65
+
66
+ Documentation:
67
+ https://docs.feldera.com/pipelines/configuration/#runtime-configuration
62
68
  """
63
69
 
64
70
  def __init__(
@@ -74,6 +80,8 @@ class RuntimeConfig:
74
80
  provisioning_timeout_secs: Optional[int] = None,
75
81
  resources: Optional[Resources] = None,
76
82
  runtime_version: Optional[str] = None,
83
+ fault_tolerance_model: Optional[FaultToleranceModel] = None,
84
+ checkpoint_interval_secs: Optional[int] = None,
77
85
  ):
78
86
  self.workers = workers
79
87
  self.tracing = tracing
@@ -86,6 +94,11 @@ class RuntimeConfig:
86
94
  self.runtime_version = runtime_version or os.environ.get(
87
95
  "FELDERA_RUNTIME_VERSION"
88
96
  )
97
+ if fault_tolerance_model is not None:
98
+ self.fault_tolerance = {
99
+ "model": str(fault_tolerance_model),
100
+ "checkpoint_interval_secs": checkpoint_interval_secs,
101
+ }
89
102
  if resources is not None:
90
103
  self.resources = resources.__dict__
91
104
  if isinstance(storage, bool):
@@ -100,7 +113,7 @@ class RuntimeConfig:
100
113
  @classmethod
101
114
  def from_dict(cls, d: Mapping[str, Any]):
102
115
  """
103
- Create a `.RuntimeConfig` object from a dictionary.
116
+ Create a :class:`.RuntimeConfig` object from a dictionary.
104
117
  """
105
118
 
106
119
  conf = cls()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: feldera
3
- Version: 0.101.0
3
+ Version: 0.102.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.101.0"
9
+ version = "0.102.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