feldera 0.30.0__tar.gz → 0.31.1__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 (29) hide show
  1. {feldera-0.30.0 → feldera-0.31.1}/PKG-INFO +1 -1
  2. {feldera-0.30.0 → feldera-0.31.1}/feldera/pipeline.py +5 -2
  3. {feldera-0.30.0 → feldera-0.31.1}/feldera/rest/feldera_client.py +20 -6
  4. {feldera-0.30.0 → feldera-0.31.1}/feldera.egg-info/PKG-INFO +1 -1
  5. {feldera-0.30.0 → feldera-0.31.1}/pyproject.toml +1 -1
  6. {feldera-0.30.0 → feldera-0.31.1}/tests/test_pipeline_builder.py +59 -0
  7. {feldera-0.30.0 → feldera-0.31.1}/README.md +0 -0
  8. {feldera-0.30.0 → feldera-0.31.1}/feldera/__init__.py +0 -0
  9. {feldera-0.30.0 → feldera-0.31.1}/feldera/_callback_runner.py +0 -0
  10. {feldera-0.30.0 → feldera-0.31.1}/feldera/_helpers.py +0 -0
  11. {feldera-0.30.0 → feldera-0.31.1}/feldera/enums.py +0 -0
  12. {feldera-0.30.0 → feldera-0.31.1}/feldera/output_handler.py +0 -0
  13. {feldera-0.30.0 → feldera-0.31.1}/feldera/pipeline_builder.py +0 -0
  14. {feldera-0.30.0 → feldera-0.31.1}/feldera/rest/__init__.py +0 -0
  15. {feldera-0.30.0 → feldera-0.31.1}/feldera/rest/_httprequests.py +0 -0
  16. {feldera-0.30.0 → feldera-0.31.1}/feldera/rest/config.py +0 -0
  17. {feldera-0.30.0 → feldera-0.31.1}/feldera/rest/errors.py +0 -0
  18. {feldera-0.30.0 → feldera-0.31.1}/feldera/rest/pipeline.py +0 -0
  19. {feldera-0.30.0 → feldera-0.31.1}/feldera/rest/sql_table.py +0 -0
  20. {feldera-0.30.0 → feldera-0.31.1}/feldera/rest/sql_view.py +0 -0
  21. {feldera-0.30.0 → feldera-0.31.1}/feldera/runtime_config.py +0 -0
  22. {feldera-0.30.0 → feldera-0.31.1}/feldera.egg-info/SOURCES.txt +0 -0
  23. {feldera-0.30.0 → feldera-0.31.1}/feldera.egg-info/dependency_links.txt +0 -0
  24. {feldera-0.30.0 → feldera-0.31.1}/feldera.egg-info/requires.txt +0 -0
  25. {feldera-0.30.0 → feldera-0.31.1}/feldera.egg-info/top_level.txt +0 -0
  26. {feldera-0.30.0 → feldera-0.31.1}/setup.cfg +0 -0
  27. {feldera-0.30.0 → feldera-0.31.1}/tests/test_pipeline.py +0 -0
  28. {feldera-0.30.0 → feldera-0.31.1}/tests/test_udf.py +0 -0
  29. {feldera-0.30.0 → feldera-0.31.1}/tests/test_variant.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: feldera
3
- Version: 0.30.0
3
+ Version: 0.31.1
4
4
  Summary: The feldera python client
5
5
  Author-email: Abhinav <abhinav.gyawali@feldera.com>
6
6
  License: MIT
@@ -233,10 +233,13 @@ class Pipeline:
233
233
  status = self.status()
234
234
  if status != PipelineStatus.SHUTDOWN:
235
235
  raise RuntimeError(
236
- f"pipeline {self.name} in state: {str(status.name)} cannot be started"
236
+ f"pipeline {self.name} in state {str(status.name)} cannot be started\n"
237
+ + self.client.get_pipeline(self.name).deployment_error.get(
238
+ "message", ""
239
+ )
237
240
  )
238
241
 
239
- self.pause()
242
+ self.client.pause_pipeline(self.name, "Unable to START the pipeline.")
240
243
  self.__setup_output_listeners()
241
244
  self.resume()
242
245
 
@@ -79,7 +79,7 @@ class FelderaClient:
79
79
  return [Pipeline.from_dict(pipeline) for pipeline in resp]
80
80
 
81
81
  def __wait_for_compilation(self, name: str):
82
- wait = ["Pending", "CompilingSql", "CompilingRust"]
82
+ wait = ["Pending", "CompilingSql", "SqlCompiled", "CompilingRust"]
83
83
 
84
84
  while True:
85
85
  p = self.get_pipeline(name)
@@ -200,35 +200,49 @@ class FelderaClient:
200
200
  )
201
201
 
202
202
  while True:
203
- status = self.get_pipeline(pipeline_name).deployment_status
203
+ resp = self.get_pipeline(pipeline_name)
204
+ status = resp.deployment_status
204
205
 
205
206
  if status == "Running":
206
207
  break
207
208
  elif status == "Failed":
208
- raise RuntimeError("Failed to start pipeline")
209
+ raise RuntimeError(
210
+ f"""Unable to START the pipeline.
211
+ Reason: The pipeline is in a FAILED state due to the following error:
212
+ {resp.deployment_error.get("message", "")}"""
213
+ )
209
214
 
210
215
  logging.debug(
211
216
  "still starting %s, waiting for 100 more milliseconds", pipeline_name
212
217
  )
213
218
  time.sleep(0.1)
214
219
 
215
- def pause_pipeline(self, pipeline_name: str):
220
+ def pause_pipeline(self, pipeline_name: str, error_message: str = None):
216
221
  """
217
222
  Stop a pipeline
218
223
 
219
224
  :param pipeline_name: The name of the pipeline to stop
225
+ :param error_message: The error message to show if the pipeline is in FAILED state
220
226
  """
221
227
  self.http.post(
222
228
  path=f"/pipelines/{pipeline_name}/pause",
223
229
  )
224
230
 
231
+ if error_message is None:
232
+ error_message = "Unable to PAUSE the pipeline.\n"
233
+
225
234
  while True:
226
- status = self.get_pipeline(pipeline_name).deployment_status
235
+ resp = self.get_pipeline(pipeline_name)
236
+ status = resp.deployment_status
227
237
 
228
238
  if status == "Paused":
229
239
  break
230
240
  elif status == "Failed":
231
- raise RuntimeError("Failed to pause pipeline")
241
+ raise RuntimeError(
242
+ error_message
243
+ + f"""Reason: The pipeline is in a FAILED state due to the following error:
244
+ {resp.deployment_error.get("message", "")}"""
245
+ )
232
246
 
233
247
  logging.debug(
234
248
  "still pausing %s, waiting for 100 more milliseconds", pipeline_name
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: feldera
3
- Version: 0.30.0
3
+ Version: 0.31.1
4
4
  Summary: The feldera python client
5
5
  Author-email: Abhinav <abhinav.gyawali@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.30.0"
9
+ version = "0.31.1"
10
10
  license = { text = "MIT" }
11
11
  requires-python = ">=3.10"
12
12
  authors = [
@@ -951,6 +951,65 @@ Code snippet:
951
951
 
952
952
  self.assertCountEqual(got, expected)
953
953
 
954
+ def test_issue2971(self):
955
+ sql = """
956
+ CREATE TABLE t0(c0 TINYINT) with ('materialized' = 'true');
957
+ CREATE MATERIALIZED VIEW v0 AS SELECT (c0 + 127::TINYINT) as out FROM t0;
958
+ """
959
+
960
+ pipeline = PipelineBuilder(
961
+ TEST_CLIENT, name="test_issue2971", sql=sql
962
+ ).create_or_replace()
963
+ pipeline.start()
964
+ pipeline.input_json("t0", {"c0": 10})
965
+
966
+ with self.assertRaises(RuntimeError) as err:
967
+ pipeline.pause()
968
+
969
+ got_err: str = err.exception.args[0].strip()
970
+ assert "attempt to add with overflow" in got_err
971
+
972
+ with self.assertRaises(RuntimeError) as err:
973
+ pipeline.start()
974
+
975
+ got_err: str = err.exception.args[0].strip()
976
+ assert "attempt to add with overflow" in got_err
977
+
978
+ pipeline.shutdown()
979
+ pipeline.delete()
980
+
981
+ def test_initialization_error(self):
982
+ sql = """
983
+ CREATE TABLE t0 (
984
+ c0 INT NOT NULL
985
+ ) with (
986
+ 'connectors' = '[{
987
+ "transport": {
988
+ "name": "datagen",
989
+ "config": {
990
+ "plan": [{
991
+ "fields": {
992
+ "c1": { "strategy": "uniform", "range": [100, 10000] }
993
+ }
994
+ }]
995
+ }
996
+ }
997
+ }]'
998
+ );
999
+ """
1000
+
1001
+ pipeline = PipelineBuilder(
1002
+ TEST_CLIENT, name="test_initialization_error", sql=sql
1003
+ ).create_or_replace()
1004
+ with self.assertRaises(RuntimeError) as err:
1005
+ pipeline.start()
1006
+
1007
+ pipeline.shutdown()
1008
+ pipeline.delete()
1009
+
1010
+ got_err: str = err.exception.args[0].strip()
1011
+ assert "error: cannot START failed pipeline" in got_err
1012
+
954
1013
 
955
1014
  if __name__ == "__main__":
956
1015
  unittest.main()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes