feldera 0.173.0__tar.gz → 0.180.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.
Files changed (31) hide show
  1. {feldera-0.173.0 → feldera-0.180.0}/PKG-INFO +1 -1
  2. {feldera-0.173.0 → feldera-0.180.0}/feldera/pipeline_builder.py +11 -7
  3. {feldera-0.173.0 → feldera-0.180.0}/feldera/rest/_httprequests.py +11 -11
  4. {feldera-0.173.0 → feldera-0.180.0}/feldera/rest/feldera_client.py +23 -11
  5. {feldera-0.173.0 → feldera-0.180.0}/feldera.egg-info/PKG-INFO +1 -1
  6. {feldera-0.173.0 → feldera-0.180.0}/pyproject.toml +1 -1
  7. {feldera-0.173.0 → feldera-0.180.0}/README.md +0 -0
  8. {feldera-0.173.0 → feldera-0.180.0}/feldera/__init__.py +0 -0
  9. {feldera-0.173.0 → feldera-0.180.0}/feldera/_callback_runner.py +0 -0
  10. {feldera-0.173.0 → feldera-0.180.0}/feldera/_helpers.py +0 -0
  11. {feldera-0.173.0 → feldera-0.180.0}/feldera/enums.py +0 -0
  12. {feldera-0.173.0 → feldera-0.180.0}/feldera/output_handler.py +0 -0
  13. {feldera-0.173.0 → feldera-0.180.0}/feldera/pipeline.py +0 -0
  14. {feldera-0.173.0 → feldera-0.180.0}/feldera/rest/__init__.py +0 -0
  15. {feldera-0.173.0 → feldera-0.180.0}/feldera/rest/_helpers.py +0 -0
  16. {feldera-0.173.0 → feldera-0.180.0}/feldera/rest/config.py +0 -0
  17. {feldera-0.173.0 → feldera-0.180.0}/feldera/rest/errors.py +0 -0
  18. {feldera-0.173.0 → feldera-0.180.0}/feldera/rest/feldera_config.py +0 -0
  19. {feldera-0.173.0 → feldera-0.180.0}/feldera/rest/pipeline.py +0 -0
  20. {feldera-0.173.0 → feldera-0.180.0}/feldera/rest/sql_table.py +0 -0
  21. {feldera-0.173.0 → feldera-0.180.0}/feldera/rest/sql_view.py +0 -0
  22. {feldera-0.173.0 → feldera-0.180.0}/feldera/runtime_config.py +0 -0
  23. {feldera-0.173.0 → feldera-0.180.0}/feldera/stats.py +0 -0
  24. {feldera-0.173.0 → feldera-0.180.0}/feldera/tests/test_datafusionize.py +0 -0
  25. {feldera-0.173.0 → feldera-0.180.0}/feldera/testutils.py +0 -0
  26. {feldera-0.173.0 → feldera-0.180.0}/feldera/testutils_oidc.py +0 -0
  27. {feldera-0.173.0 → feldera-0.180.0}/feldera.egg-info/SOURCES.txt +0 -0
  28. {feldera-0.173.0 → feldera-0.180.0}/feldera.egg-info/dependency_links.txt +0 -0
  29. {feldera-0.173.0 → feldera-0.180.0}/feldera.egg-info/requires.txt +0 -0
  30. {feldera-0.173.0 → feldera-0.180.0}/feldera.egg-info/top_level.txt +0 -0
  31. {feldera-0.173.0 → feldera-0.180.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: feldera
3
- Version: 0.173.0
3
+ Version: 0.180.0
4
4
  Summary: The feldera python client
5
5
  Author-email: Feldera Team <dev@feldera.com>
6
6
  License: MIT
@@ -1,12 +1,12 @@
1
1
  import os
2
2
  from typing import Optional
3
3
 
4
+ from feldera.enums import CompilationProfile, PipelineFieldSelector
5
+ from feldera.pipeline import Pipeline
6
+ from feldera.rest.errors import FelderaAPIError
4
7
  from feldera.rest.feldera_client import FelderaClient
5
8
  from feldera.rest.pipeline import Pipeline as InnerPipeline
6
- from feldera.pipeline import Pipeline
7
- from feldera.enums import CompilationProfile, PipelineFieldSelector
8
9
  from feldera.runtime_config import RuntimeConfig
9
- from feldera.rest.errors import FelderaAPIError
10
10
 
11
11
 
12
12
  class PipelineBuilder:
@@ -49,10 +49,11 @@ class PipelineBuilder:
49
49
  "FELDERA_RUNTIME_VERSION", runtime_version
50
50
  )
51
51
 
52
- def create(self) -> Pipeline:
52
+ def create(self, wait: bool = True) -> Pipeline:
53
53
  """
54
54
  Create the pipeline if it does not exist.
55
55
 
56
+ :param wait: Whether to wait for the pipeline to be created. True by default
56
57
  :return: The created pipeline
57
58
  """
58
59
 
@@ -82,17 +83,20 @@ class PipelineBuilder:
82
83
  runtime_config=self.runtime_config.to_dict(),
83
84
  )
84
85
 
85
- inner = self.client.create_pipeline(inner)
86
+ inner = self.client.create_pipeline(inner, wait=wait)
86
87
  pipeline = Pipeline(self.client)
87
88
  pipeline._inner = inner
88
89
 
89
90
  return pipeline
90
91
 
91
- def create_or_replace(self) -> Pipeline:
92
+ def create_or_replace(self, wait: bool = True) -> Pipeline:
92
93
  """
93
94
  Creates a pipeline if it does not exist and replaces it if it exists.
94
95
 
95
96
  If the pipeline exists and is running, it will be stopped and replaced.
97
+
98
+ :param wait: Whether to wait for the pipeline to be created. True by default
99
+ :return: The created pipeline
96
100
  """
97
101
 
98
102
  if self.name is None or self.sql is None:
@@ -121,7 +125,7 @@ class PipelineBuilder:
121
125
  runtime_config=self.runtime_config.to_dict(),
122
126
  )
123
127
 
124
- inner = self.client.create_or_update_pipeline(inner)
128
+ inner = self.client.create_or_update_pipeline(inner, wait=wait)
125
129
  pipeline = Pipeline(self.client)
126
130
  pipeline._inner = inner
127
131
 
@@ -1,19 +1,18 @@
1
+ import json
1
2
  import logging
3
+ import time
4
+ from typing import Any, Callable, List, Mapping, Optional, Sequence, Union
2
5
 
3
- from feldera.rest.config import Config
6
+ import requests
7
+ from requests.packages import urllib3
4
8
 
9
+ from feldera.rest.config import Config
5
10
  from feldera.rest.errors import (
6
11
  FelderaAPIError,
7
- FelderaTimeoutError,
8
12
  FelderaCommunicationError,
13
+ FelderaTimeoutError,
9
14
  )
10
15
 
11
- import json
12
- import requests
13
- from requests.packages import urllib3
14
- from typing import Callable, Optional, Any, Union, Mapping, Sequence, List
15
- import time
16
-
17
16
 
18
17
  def json_serialize(body: Any) -> str:
19
18
  # serialize as string if this object cannot be serialized (e.g. UUID)
@@ -111,11 +110,12 @@ class HttpRequests:
111
110
  logging.debug("got response: %s", str(resp))
112
111
  return resp
113
112
  except FelderaAPIError as err:
114
- # Only retry on 503
115
- if err.status_code == 503:
113
+ # Only retry on 503 and 408
114
+ if err.status_code in [503, 408]:
116
115
  if attempt < max_retries:
117
116
  logging.warning(
118
- "HTTP 503 received for %s, retrying (%d/%d)...",
117
+ "HTTP %d received for %s, retrying (%d/%d)...",
118
+ err.status_code,
119
119
  path,
120
120
  attempt + 1,
121
121
  max_retries,
@@ -1,20 +1,20 @@
1
- import pathlib
2
- from typing import Any, Dict, Optional
1
+ import json
3
2
  import logging
3
+ import pathlib
4
4
  import time
5
- import json
6
5
  from decimal import Decimal
7
- from typing import Generator, Mapping
6
+ from typing import Any, Dict, Generator, Mapping, Optional
8
7
  from urllib.parse import quote
8
+
9
9
  import requests
10
10
 
11
11
  from feldera.enums import BootstrapPolicy, PipelineFieldSelector, PipelineStatus
12
+ from feldera.rest._helpers import client_version
13
+ from feldera.rest._httprequests import HttpRequests
12
14
  from feldera.rest.config import Config
15
+ from feldera.rest.errors import FelderaAPIError, FelderaTimeoutError
13
16
  from feldera.rest.feldera_config import FelderaConfig
14
- from feldera.rest.errors import FelderaTimeoutError, FelderaAPIError
15
17
  from feldera.rest.pipeline import Pipeline
16
- from feldera.rest._httprequests import HttpRequests
17
- from feldera.rest._helpers import client_version
18
18
 
19
19
 
20
20
  def _validate_no_none_keys_in_map(data):
@@ -258,12 +258,12 @@ Reason: The pipeline is in a STOPPED state due to the following error:
258
258
  )
259
259
  time.sleep(0.1)
260
260
 
261
- def create_pipeline(self, pipeline: Pipeline) -> Pipeline:
261
+ def create_pipeline(self, pipeline: Pipeline, wait: bool = True) -> Pipeline:
262
262
  """
263
263
  Create a pipeline if it doesn't exist and wait for it to compile
264
264
 
265
-
266
- :name: The name of the pipeline
265
+ :param pipeline: The pipeline to create
266
+ :param wait: Whether to wait for the pipeline to compile. True by default
267
267
  """
268
268
 
269
269
  body = {
@@ -281,12 +281,21 @@ Reason: The pipeline is in a STOPPED state due to the following error:
281
281
  body=body,
282
282
  )
283
283
 
284
+ if not wait:
285
+ return pipeline
286
+
284
287
  return self.__wait_for_compilation(pipeline.name)
285
288
 
286
- def create_or_update_pipeline(self, pipeline: Pipeline) -> Pipeline:
289
+ def create_or_update_pipeline(
290
+ self, pipeline: Pipeline, wait: bool = True
291
+ ) -> Pipeline:
287
292
  """
288
293
  Create a pipeline if it doesn't exist or update a pipeline and wait for
289
294
  it to compile
295
+
296
+ :param pipeline: The pipeline to create or update
297
+ :param wait: Whether to wait for the pipeline to compile. True by default
298
+ :return: The created or updated pipeline
290
299
  """
291
300
 
292
301
  body = {
@@ -304,6 +313,9 @@ Reason: The pipeline is in a STOPPED state due to the following error:
304
313
  body=body,
305
314
  )
306
315
 
316
+ if not wait:
317
+ return pipeline
318
+
307
319
  return self.__wait_for_compilation(pipeline.name)
308
320
 
309
321
  def patch_pipeline(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: feldera
3
- Version: 0.173.0
3
+ Version: 0.180.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.173.0"
9
+ version = "0.180.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