feldera 0.36.0__tar.gz → 0.38.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.
- {feldera-0.36.0 → feldera-0.38.0}/PKG-INFO +1 -1
- {feldera-0.36.0 → feldera-0.38.0}/feldera/rest/_httprequests.py +9 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera/rest/config.py +4 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera/rest/feldera_client.py +6 -1
- {feldera-0.36.0 → feldera-0.38.0}/feldera/runtime_config.py +19 -3
- {feldera-0.36.0 → feldera-0.38.0}/feldera.egg-info/PKG-INFO +1 -1
- {feldera-0.36.0 → feldera-0.38.0}/pyproject.toml +1 -1
- {feldera-0.36.0 → feldera-0.38.0}/tests/test_pipeline_builder.py +14 -8
- {feldera-0.36.0 → feldera-0.38.0}/tests/test_udf.py +6 -6
- {feldera-0.36.0 → feldera-0.38.0}/README.md +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera/__init__.py +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera/_callback_runner.py +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera/_helpers.py +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera/enums.py +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera/output_handler.py +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera/pipeline.py +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera/pipeline_builder.py +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera/rest/__init__.py +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera/rest/errors.py +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera/rest/pipeline.py +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera/rest/sql_table.py +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera/rest/sql_view.py +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera.egg-info/SOURCES.txt +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera.egg-info/dependency_links.txt +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera.egg-info/requires.txt +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/feldera.egg-info/top_level.txt +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/setup.cfg +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/tests/test_pipeline.py +0 -0
- {feldera-0.36.0 → feldera-0.38.0}/tests/test_variant.py +0 -0
|
@@ -10,6 +10,7 @@ from feldera.rest.errors import (
|
|
|
10
10
|
|
|
11
11
|
import json
|
|
12
12
|
import requests
|
|
13
|
+
from requests.packages import urllib3
|
|
13
14
|
from typing import Callable, Optional, Any, Union, Mapping, Sequence, List
|
|
14
15
|
|
|
15
16
|
|
|
@@ -22,6 +23,11 @@ class HttpRequests:
|
|
|
22
23
|
def __init__(self, config: Config) -> None:
|
|
23
24
|
self.config = config
|
|
24
25
|
self.headers = {"User-Agent": "feldera-python-sdk/v1"}
|
|
26
|
+
self.requests_verify = config.requests_verify
|
|
27
|
+
|
|
28
|
+
if not self.requests_verify:
|
|
29
|
+
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
30
|
+
|
|
25
31
|
if self.config.api_key:
|
|
26
32
|
self.headers["Authorization"] = f"Bearer {self.config.api_key}"
|
|
27
33
|
|
|
@@ -69,6 +75,7 @@ class HttpRequests:
|
|
|
69
75
|
headers=headers,
|
|
70
76
|
params=params,
|
|
71
77
|
stream=stream,
|
|
78
|
+
verify=self.requests_verify,
|
|
72
79
|
)
|
|
73
80
|
elif isinstance(body, bytes):
|
|
74
81
|
request = http_method(
|
|
@@ -78,6 +85,7 @@ class HttpRequests:
|
|
|
78
85
|
data=body,
|
|
79
86
|
params=params,
|
|
80
87
|
stream=stream,
|
|
88
|
+
verify=self.requests_verify,
|
|
81
89
|
)
|
|
82
90
|
else:
|
|
83
91
|
request = http_method(
|
|
@@ -87,6 +95,7 @@ class HttpRequests:
|
|
|
87
95
|
data=json_serialize(body) if serialize else body,
|
|
88
96
|
params=params,
|
|
89
97
|
stream=stream,
|
|
98
|
+
verify=self.requests_verify,
|
|
90
99
|
)
|
|
91
100
|
|
|
92
101
|
resp = self.__validate(request, stream=stream)
|
|
@@ -12,15 +12,19 @@ class Config:
|
|
|
12
12
|
api_key: Optional[str] = None,
|
|
13
13
|
version: Optional[str] = None,
|
|
14
14
|
timeout: Optional[float] = None,
|
|
15
|
+
requests_verify: bool = True,
|
|
15
16
|
) -> None:
|
|
16
17
|
"""
|
|
17
18
|
:param url: The url to the Feldera API (ex: https://try.feldera.com)
|
|
18
19
|
:param api_key: The optional API key to access Feldera
|
|
19
20
|
:param version: The version of the API to use
|
|
20
21
|
:param timeout: The timeout for the HTTP requests
|
|
22
|
+
:param requests_verify: The `verify` parameter passed to the requests
|
|
23
|
+
library. `True` by default.
|
|
21
24
|
"""
|
|
22
25
|
|
|
23
26
|
self.url: str = url
|
|
24
27
|
self.api_key: Optional[str] = api_key
|
|
25
28
|
self.version: Optional[str] = version or "v0"
|
|
26
29
|
self.timeout: Optional[float] = timeout
|
|
30
|
+
self.requests_verify: bool = requests_verify
|
|
@@ -29,15 +29,20 @@ class FelderaClient:
|
|
|
29
29
|
url: str,
|
|
30
30
|
api_key: Optional[str] = None,
|
|
31
31
|
timeout: Optional[float] = None,
|
|
32
|
+
requests_verify: bool = True,
|
|
32
33
|
) -> None:
|
|
33
34
|
"""
|
|
34
35
|
:param url: The url to Feldera API (ex: https://try.feldera.com)
|
|
35
36
|
:param api_key: The optional API key for Feldera
|
|
36
37
|
:param timeout: (optional) The amount of time in seconds that the client will wait for a response before timing
|
|
37
38
|
out.
|
|
39
|
+
:param requests_verify: The `verify` parameter passed to the requests
|
|
40
|
+
library. `True` by default.
|
|
38
41
|
"""
|
|
39
42
|
|
|
40
|
-
self.config = Config(
|
|
43
|
+
self.config = Config(
|
|
44
|
+
url, api_key, timeout=timeout, requests_verify=requests_verify
|
|
45
|
+
)
|
|
41
46
|
self.http = HttpRequests(self.config)
|
|
42
47
|
|
|
43
48
|
try:
|
|
@@ -37,6 +37,24 @@ class Resources:
|
|
|
37
37
|
self.__dict__.update(config)
|
|
38
38
|
|
|
39
39
|
|
|
40
|
+
class Storage:
|
|
41
|
+
"""Storage configuration for a pipeline.
|
|
42
|
+
|
|
43
|
+
:param min_storage_bytes: The minimum estimated number of bytes in a batch of data to write it to storage.
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
def __init__(
|
|
47
|
+
self,
|
|
48
|
+
config: Optional[Mapping[str, Any]] = None,
|
|
49
|
+
min_storage_bytes: Optional[int] = None,
|
|
50
|
+
):
|
|
51
|
+
config = config or {}
|
|
52
|
+
|
|
53
|
+
self.min_storage_bytes = min_storage_bytes
|
|
54
|
+
|
|
55
|
+
self.__dict__.update(config)
|
|
56
|
+
|
|
57
|
+
|
|
40
58
|
class RuntimeConfig:
|
|
41
59
|
"""
|
|
42
60
|
Runtime configuration class to define the configuration for a pipeline.
|
|
@@ -45,13 +63,12 @@ class RuntimeConfig:
|
|
|
45
63
|
def __init__(
|
|
46
64
|
self,
|
|
47
65
|
workers: Optional[int] = None,
|
|
48
|
-
storage: Optional[
|
|
66
|
+
storage: Optional[Storage] = None,
|
|
49
67
|
tracing: Optional[bool] = False,
|
|
50
68
|
tracing_endpoint_jaeger: Optional[str] = "",
|
|
51
69
|
cpu_profiler: bool = True,
|
|
52
70
|
max_buffering_delay_usecs: int = 0,
|
|
53
71
|
min_batch_size_records: int = 0,
|
|
54
|
-
min_storage_bytes: Optional[int] = None,
|
|
55
72
|
clock_resolution_usecs: Optional[int] = None,
|
|
56
73
|
resources: Optional[Resources] = None,
|
|
57
74
|
):
|
|
@@ -62,7 +79,6 @@ class RuntimeConfig:
|
|
|
62
79
|
self.cpu_profiler = cpu_profiler
|
|
63
80
|
self.max_buffering_delay_usecs = max_buffering_delay_usecs
|
|
64
81
|
self.min_batch_size_records = min_batch_size_records
|
|
65
|
-
self.min_storage_bytes = min_storage_bytes
|
|
66
82
|
self.clock_resolution_usecs = clock_resolution_usecs
|
|
67
83
|
if resources is not None:
|
|
68
84
|
self.resources = resources.__dict__
|
|
@@ -492,14 +492,20 @@ Code snippet:
|
|
|
492
492
|
"format": {{
|
|
493
493
|
"name": "avro",
|
|
494
494
|
"config": {{
|
|
495
|
-
"schema": {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
}
|
|
495
|
+
"schema": {
|
|
496
|
+
json.dumps(
|
|
497
|
+
json.dumps(
|
|
498
|
+
{
|
|
499
|
+
"type": "record",
|
|
500
|
+
"name": "items",
|
|
501
|
+
"fields": [
|
|
502
|
+
{"name": "id", "type": ["null", "int"]},
|
|
503
|
+
{"name": "name", "type": ["null", "string"]},
|
|
504
|
+
],
|
|
505
|
+
}
|
|
506
|
+
)
|
|
507
|
+
)
|
|
508
|
+
}
|
|
503
509
|
}}
|
|
504
510
|
}}
|
|
505
511
|
}}
|
|
@@ -193,16 +193,16 @@ pub fn t2t(i: Option<Time>) -> Result<Option<Time>, Box<dyn std::error::Error>>
|
|
|
193
193
|
pub fn nt2nt(i: Time) -> Result<Time, Box<dyn std::error::Error>> {
|
|
194
194
|
Ok(i)
|
|
195
195
|
}
|
|
196
|
-
pub fn arr2arr(i: Option<
|
|
196
|
+
pub fn arr2arr(i: Option<Array<Option<i32>>>) -> Result<Option<Array<Option<i32>>>, Box<dyn std::error::Error>> {
|
|
197
197
|
Ok(i)
|
|
198
198
|
}
|
|
199
|
-
pub fn narr2narr(i:
|
|
199
|
+
pub fn narr2narr(i: Array<Option<i32>>) -> Result<Array<Option<i32>>, Box<dyn std::error::Error>> {
|
|
200
200
|
Ok(i)
|
|
201
201
|
}
|
|
202
|
-
pub fn map2map(i: Option<
|
|
202
|
+
pub fn map2map(i: Option<Map<SqlString, Option<SqlString>>>) -> Result<Option<Map<SqlString, Option<SqlString>>>, Box<dyn std::error::Error>> {
|
|
203
203
|
Ok(i)
|
|
204
204
|
}
|
|
205
|
-
pub fn nmap2nmap(i:
|
|
205
|
+
pub fn nmap2nmap(i: Map<SqlString, Option<SqlString>>) -> Result<Map<SqlString, Option<SqlString>>, Box<dyn std::error::Error>> {
|
|
206
206
|
Ok(i)
|
|
207
207
|
}
|
|
208
208
|
pub fn var2var(i: Option<Variant>) -> Result<Option<Variant>, Box<dyn std::error::Error>> {
|
|
@@ -217,10 +217,10 @@ pub fn dec2dec(i: Option<Decimal>) -> Result<Option<Decimal>, Box<dyn std::error
|
|
|
217
217
|
pub fn ndec2ndec(i: Decimal) -> Result<Decimal, Box<dyn std::error::Error>> {
|
|
218
218
|
Ok(i)
|
|
219
219
|
}
|
|
220
|
-
pub fn str2str(i: Option<
|
|
220
|
+
pub fn str2str(i: Option<SqlString>) -> Result<Option<SqlString>, Box<dyn std::error::Error>> {
|
|
221
221
|
Ok(i)
|
|
222
222
|
}
|
|
223
|
-
pub fn nstr2nstr(i:
|
|
223
|
+
pub fn nstr2nstr(i: SqlString) -> Result<SqlString, Box<dyn std::error::Error>> {
|
|
224
224
|
Ok(i)
|
|
225
225
|
}
|
|
226
226
|
// pub fn struct2struct(i: Option<struct_1>) -> Result<Option<struct_2>, Box<dyn std::error::Error>> {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|