feldera 0.112.0__py3-none-any.whl → 0.113.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/_callback_runner.py +3 -1
- feldera/pipeline.py +2 -0
- feldera/rest/_httprequests.py +50 -33
- feldera/rest/feldera_client.py +10 -7
- {feldera-0.112.0.dist-info → feldera-0.113.0.dist-info}/METADATA +5 -5
- {feldera-0.112.0.dist-info → feldera-0.113.0.dist-info}/RECORD +8 -8
- {feldera-0.112.0.dist-info → feldera-0.113.0.dist-info}/WHEEL +0 -0
- {feldera-0.112.0.dist-info → feldera-0.113.0.dist-info}/top_level.txt +0 -0
feldera/_callback_runner.py
CHANGED
|
@@ -75,7 +75,9 @@ class CallbackRunner(Thread):
|
|
|
75
75
|
# stop blocking the main thread on `join` for the previous message
|
|
76
76
|
self.queue.task_done()
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
iterator = gen_obj()
|
|
79
|
+
|
|
80
|
+
for chunk in iterator:
|
|
79
81
|
chunk: dict = chunk
|
|
80
82
|
data: Optional[list[dict]] = chunk.get("json_data")
|
|
81
83
|
seq_no: Optional[int] = chunk.get("sequence_number")
|
feldera/pipeline.py
CHANGED
|
@@ -484,7 +484,9 @@ metrics"""
|
|
|
484
484
|
for view_name, queue in self.views_tx.pop().items():
|
|
485
485
|
# block until the callback runner has been stopped
|
|
486
486
|
queue.join()
|
|
487
|
+
import time
|
|
487
488
|
|
|
489
|
+
time.sleep(3)
|
|
488
490
|
self.client.stop_pipeline(self.name, force=force, timeout_s=timeout_s)
|
|
489
491
|
|
|
490
492
|
def resume(self, timeout_s: Optional[float] = None):
|
feldera/rest/_httprequests.py
CHANGED
|
@@ -12,6 +12,7 @@ import json
|
|
|
12
12
|
import requests
|
|
13
13
|
from requests.packages import urllib3
|
|
14
14
|
from typing import Callable, Optional, Any, Union, Mapping, Sequence, List
|
|
15
|
+
import time
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
def json_serialize(body: Any) -> str:
|
|
@@ -42,6 +43,7 @@ class HttpRequests:
|
|
|
42
43
|
params: Optional[Mapping[str, Any]] = None,
|
|
43
44
|
stream: bool = False,
|
|
44
45
|
serialize: bool = True,
|
|
46
|
+
max_retries: int = 3,
|
|
45
47
|
) -> Any:
|
|
46
48
|
"""
|
|
47
49
|
:param http_method: The HTTP method to use. Takes the equivalent `requests.*` module. (Example: `requests.get`)
|
|
@@ -68,39 +70,54 @@ class HttpRequests:
|
|
|
68
70
|
str(params),
|
|
69
71
|
)
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
73
|
+
for attempt in range(max_retries):
|
|
74
|
+
if http_method.__name__ == "get":
|
|
75
|
+
request = http_method(
|
|
76
|
+
request_path,
|
|
77
|
+
timeout=timeout,
|
|
78
|
+
headers=headers,
|
|
79
|
+
params=params,
|
|
80
|
+
stream=stream,
|
|
81
|
+
verify=self.requests_verify,
|
|
82
|
+
)
|
|
83
|
+
elif isinstance(body, bytes):
|
|
84
|
+
request = http_method(
|
|
85
|
+
request_path,
|
|
86
|
+
timeout=timeout,
|
|
87
|
+
headers=headers,
|
|
88
|
+
data=body,
|
|
89
|
+
params=params,
|
|
90
|
+
stream=stream,
|
|
91
|
+
verify=self.requests_verify,
|
|
92
|
+
)
|
|
93
|
+
else:
|
|
94
|
+
request = http_method(
|
|
95
|
+
request_path,
|
|
96
|
+
timeout=timeout,
|
|
97
|
+
headers=headers,
|
|
98
|
+
data=json_serialize(body) if serialize else body,
|
|
99
|
+
params=params,
|
|
100
|
+
stream=stream,
|
|
101
|
+
verify=self.requests_verify,
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
try:
|
|
105
|
+
resp = self.__validate(request, stream=stream)
|
|
106
|
+
logging.debug("got response: %s", str(resp))
|
|
107
|
+
return resp
|
|
108
|
+
except FelderaAPIError as err:
|
|
109
|
+
# Only retry on 503
|
|
110
|
+
if err.status_code == 503:
|
|
111
|
+
if attempt < max_retries:
|
|
112
|
+
logging.warning(
|
|
113
|
+
"HTTP 503 received for %s, retrying (%d/%d)...",
|
|
114
|
+
path,
|
|
115
|
+
attempt + 1,
|
|
116
|
+
max_retries,
|
|
117
|
+
)
|
|
118
|
+
time.sleep(2) # backoff, adjust as needed
|
|
119
|
+
continue
|
|
120
|
+
raise # re-raise for all other errors or if out of retries
|
|
104
121
|
|
|
105
122
|
except requests.exceptions.Timeout as err:
|
|
106
123
|
raise FelderaTimeoutError(str(err)) from err
|
feldera/rest/feldera_client.py
CHANGED
|
@@ -605,13 +605,16 @@ Reason: The pipeline is in a STOPPED state due to the following error:
|
|
|
605
605
|
|
|
606
606
|
end = time.monotonic() + timeout if timeout else None
|
|
607
607
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
608
|
+
def generator():
|
|
609
|
+
# Using the default chunk size below makes `iter_lines` extremely
|
|
610
|
+
# inefficient when dealing with long lines.
|
|
611
|
+
for chunk in resp.iter_lines(chunk_size=50000000):
|
|
612
|
+
if end and time.monotonic() > end:
|
|
613
|
+
break
|
|
614
|
+
if chunk:
|
|
615
|
+
yield json.loads(chunk, parse_float=Decimal)
|
|
616
|
+
|
|
617
|
+
return generator
|
|
615
618
|
|
|
616
619
|
def query_as_text(
|
|
617
620
|
self, pipeline_name: str, query: str
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: feldera
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.113.0
|
|
4
4
|
Summary: The feldera python client
|
|
5
5
|
Author-email: Feldera Team <dev@feldera.com>
|
|
6
6
|
License: MIT
|
|
@@ -92,14 +92,14 @@ To run tests from a specific file:
|
|
|
92
92
|
(cd python && python3 -m pytest ./tests/path-to-file.py)
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
#### Running
|
|
95
|
+
#### Running Tests
|
|
96
96
|
|
|
97
|
-
The
|
|
98
|
-
|
|
97
|
+
The tests validate end-to-end correctness of SQL functionality. To
|
|
98
|
+
run the tests use:
|
|
99
99
|
|
|
100
100
|
```bash
|
|
101
101
|
cd python
|
|
102
|
-
PYTHONPATH=`pwd`
|
|
102
|
+
PYTHONPATH=`pwd` ./tests/run-all-tests.sh
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
### Reducing Compilation Cycles
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
feldera/__init__.py,sha256=EiY3bTj_mnfNhCGrZo6J__brfovIJ-YYAdy77PyaEoo,378
|
|
2
|
-
feldera/_callback_runner.py,sha256
|
|
2
|
+
feldera/_callback_runner.py,sha256=-2hYG70cEkvz4BiOfUTARaH-2Rlv0Qcz-ilvodgyK10,4797
|
|
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=
|
|
6
|
+
feldera/pipeline.py,sha256=1XNjqvD9MTXLuz6lomuySTF4WZndTVQFv_4OmLkKzq8,35206
|
|
7
7
|
feldera/pipeline_builder.py,sha256=25tncJd-qiuHWZOezU34oGfDJqFAdjBEMd9QipNfswc,4195
|
|
8
8
|
feldera/runtime_config.py,sha256=MuYJPd5G_hnu_eDz4ge4BfYvSBSOvOEtv4NYh5sEwqU,4452
|
|
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
|
-
feldera/rest/_httprequests.py,sha256=
|
|
12
|
+
feldera/rest/_httprequests.py,sha256=w8tD-_3spAf4vgalJQceIHQ7qw1uvxprDFM2oz3P5QU,7559
|
|
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=
|
|
15
|
+
feldera/rest/feldera_client.py,sha256=21Izb8DVv06LxdxvnByR_Mhm-lOLmKtnAc00PW7bTmc,25977
|
|
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.
|
|
21
|
-
feldera-0.
|
|
22
|
-
feldera-0.
|
|
23
|
-
feldera-0.
|
|
20
|
+
feldera-0.113.0.dist-info/METADATA,sha256=9vLMTZqEujZQQ03xDujHAiKs9g0hr982fEHzVqgXyP4,4057
|
|
21
|
+
feldera-0.113.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
22
|
+
feldera-0.113.0.dist-info/top_level.txt,sha256=fB6yTqrQiO6RCbY1xP2T_mpPoTjDFtJvkJJodiee7d0,8
|
|
23
|
+
feldera-0.113.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|