feldera 0.131.0__py3-none-any.whl → 0.192.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/__init__.py +2 -2
- feldera/_callback_runner.py +64 -88
- feldera/_helpers.py +8 -2
- feldera/enums.py +145 -92
- feldera/output_handler.py +16 -4
- feldera/pipeline.py +413 -152
- feldera/pipeline_builder.py +15 -8
- feldera/rest/_helpers.py +32 -1
- feldera/rest/_httprequests.py +365 -219
- feldera/rest/config.py +44 -33
- feldera/rest/errors.py +16 -0
- feldera/rest/feldera_client.py +395 -203
- feldera/rest/pipeline.py +15 -0
- feldera/runtime_config.py +4 -0
- feldera/stats.py +4 -1
- feldera/tests/test_datafusionize.py +38 -0
- feldera/testutils.py +382 -0
- feldera/testutils_oidc.py +368 -0
- feldera-0.192.0.dist-info/METADATA +163 -0
- feldera-0.192.0.dist-info/RECORD +26 -0
- feldera-0.131.0.dist-info/METADATA +0 -102
- feldera-0.131.0.dist-info/RECORD +0 -23
- {feldera-0.131.0.dist-info → feldera-0.192.0.dist-info}/WHEEL +0 -0
- {feldera-0.131.0.dist-info → feldera-0.192.0.dist-info}/top_level.txt +0 -0
feldera/rest/config.py
CHANGED
|
@@ -1,33 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
:
|
|
20
|
-
:
|
|
21
|
-
:
|
|
22
|
-
:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
self.
|
|
33
|
-
self.
|
|
1
|
+
import logging
|
|
2
|
+
import os
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from feldera.rest._helpers import requests_verify_from_env
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Config:
|
|
9
|
+
"""
|
|
10
|
+
:class:`.FelderaClient` configuration, which includes authentication information
|
|
11
|
+
and the address of the Feldera API the client will interact with.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(
|
|
15
|
+
self,
|
|
16
|
+
url: Optional[str] = None,
|
|
17
|
+
api_key: Optional[str] = None,
|
|
18
|
+
version: Optional[str] = None,
|
|
19
|
+
timeout: Optional[float] = None,
|
|
20
|
+
connection_timeout: Optional[float] = None,
|
|
21
|
+
requests_verify: Optional[bool | str] = None,
|
|
22
|
+
health_recovery_timeout: Optional[int] = None,
|
|
23
|
+
) -> None:
|
|
24
|
+
"""
|
|
25
|
+
See documentation of the `FelderaClient` constructor for the other arguments.
|
|
26
|
+
|
|
27
|
+
:param version: (Optional) Version of the API to use.
|
|
28
|
+
Default: `v0`.
|
|
29
|
+
:param health_recovery_timeout: (Optional) Maximum time in seconds to wait for cluster health recovery after a 502 error.
|
|
30
|
+
Default: `300` (5 minutes).
|
|
31
|
+
"""
|
|
32
|
+
self.url: str = url or os.environ.get("FELDERA_HOST") or "http://localhost:8080"
|
|
33
|
+
self.api_key: Optional[str] = api_key or os.environ.get("FELDERA_API_KEY")
|
|
34
|
+
self.version: str = version or "v0"
|
|
35
|
+
self.timeout: Optional[float] = timeout
|
|
36
|
+
self.connection_timeout: Optional[float] = connection_timeout
|
|
37
|
+
self.health_recovery_timeout: int = health_recovery_timeout or 300
|
|
38
|
+
env_verify = requests_verify_from_env()
|
|
39
|
+
self.requests_verify: bool | str = (
|
|
40
|
+
requests_verify if requests_verify is not None else env_verify
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
if self.requests_verify is False:
|
|
44
|
+
logging.warning("Feldera client: TLS verification is disabled!")
|
feldera/rest/errors.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from requests import Response
|
|
2
2
|
import json
|
|
3
|
+
from urllib.parse import urlparse
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
class FelderaError(Exception):
|
|
@@ -40,6 +41,21 @@ class FelderaAPIError(FelderaError):
|
|
|
40
41
|
self.details = json_data.get("details")
|
|
41
42
|
except Exception:
|
|
42
43
|
self.message = request.text
|
|
44
|
+
err_msg += request.text
|
|
45
|
+
|
|
46
|
+
err_msg += f"\nResponse Status: {request.status_code}"
|
|
47
|
+
|
|
48
|
+
if int(request.status_code) == 401:
|
|
49
|
+
parsed = urlparse(request.request.url)
|
|
50
|
+
|
|
51
|
+
auth_err = f"\nAuthorization error: Failed to connect to '{parsed.scheme}://{parsed.hostname}': "
|
|
52
|
+
auth = request.request.headers.get("Authorization")
|
|
53
|
+
if auth is None:
|
|
54
|
+
err_msg += f"{auth_err} API key not set"
|
|
55
|
+
else:
|
|
56
|
+
err_msg += f"{auth_err} invalid API key"
|
|
57
|
+
|
|
58
|
+
err_msg = err_msg.strip()
|
|
43
59
|
|
|
44
60
|
super().__init__(err_msg)
|
|
45
61
|
|