feldera 0.37.0__py3-none-any.whl → 0.39.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.

@@ -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)
feldera/rest/config.py CHANGED
@@ -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(url, api_key, timeout=timeout)
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:
@@ -98,8 +103,8 @@ class FelderaClient:
98
103
  return p
99
104
  elif status not in wait:
100
105
  # error handling for SQL compilation errors
101
- if isinstance(status, dict):
102
- sql_errors = status.get("SqlError")
106
+ if status == "SqlError":
107
+ sql_errors = p.program_error["sql_compilation"]["messages"]
103
108
  if sql_errors:
104
109
  err_msg = f"Pipeline {name} failed to compile:\n"
105
110
  for sql_error in sql_errors:
feldera/rest/pipeline.py CHANGED
@@ -55,6 +55,7 @@ class Pipeline:
55
55
  )
56
56
  self.program_status: Optional[str] = None
57
57
  self.program_status_since: Optional[str] = None
58
+ self.program_error: Optional[dict] = None
58
59
 
59
60
  @classmethod
60
61
  def from_dict(cls, d: Mapping[str, Any]):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: feldera
3
- Version: 0.37.0
3
+ Version: 0.39.0
4
4
  Summary: The feldera python client
5
5
  Author-email: Abhinav <abhinav.gyawali@feldera.com>
6
6
  License: MIT
@@ -7,14 +7,14 @@ feldera/pipeline.py,sha256=yDU5vSRk-2I5P1VeV_Ix5rCDLbjNIkIYEP_gA2vWSIU,29705
7
7
  feldera/pipeline_builder.py,sha256=4rmklRZ0-otvTUb-HTESfNsJopEK-E2jxpJXiYlKpps,3664
8
8
  feldera/runtime_config.py,sha256=hlIm2QTEqnUy7ucqS1iQN23ElR5d5aMwGvv_PxjHk8I,3243
9
9
  feldera/rest/__init__.py,sha256=Eg-EKUU3RSTDcdxTR_7wNDnCly8VpXEzsZCQUmf-y2M,308
10
- feldera/rest/_httprequests.py,sha256=kMW0yG1a0Mdcxnc6ShXUiL5zpBZZyGkhB5X3RGyaEUE,6269
11
- feldera/rest/config.py,sha256=84Lj2QX6SYNZJdBfrCHPMh29Nj4MY7nRB-uddytx_ok,795
10
+ feldera/rest/_httprequests.py,sha256=e22YbpzOzy7MGo7hk9MOU7ZRTj3F314grY0Ygr-_goI,6636
11
+ feldera/rest/config.py,sha256=DYzZKngDEhouTEwqVFd-rDrBN9tWqsU07Jl_BTT4mXs,1008
12
12
  feldera/rest/errors.py,sha256=b4i2JjrbSmej7jdko_FL8UeXklLKenSipwMT80jowaM,1720
13
- feldera/rest/feldera_client.py,sha256=kTNN3DaxQ5gnCpTYAggpdlMpBKJJ15bYh_WXI6FzGzU,20570
14
- feldera/rest/pipeline.py,sha256=o6BFLL3DuurvAhneX1LH7mLjbvX3dn4lCXziYRciUI4,2788
13
+ feldera/rest/feldera_client.py,sha256=rCTc3wUijjaYzqcnEMFl4PxNO5pkqzfWZN8zl0h7RnU,20806
14
+ feldera/rest/pipeline.py,sha256=a1lx-64SYak5mHX5yKElVijdfaAt5sDYVhVIXCJ97QQ,2839
15
15
  feldera/rest/sql_table.py,sha256=qrw-YwMzx5T81zDefNO1KOx7EyypFz1vPwGBzSUB7kc,652
16
16
  feldera/rest/sql_view.py,sha256=hN12mPM0mvwLCIPYywpb12s9Hd2Ws31IlTMXPriMisw,644
17
- feldera-0.37.0.dist-info/METADATA,sha256=5eHpuM-hUX1BTgjgsE712foC5vknMpgTrJc6BaQfU7o,2582
18
- feldera-0.37.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
19
- feldera-0.37.0.dist-info/top_level.txt,sha256=fB6yTqrQiO6RCbY1xP2T_mpPoTjDFtJvkJJodiee7d0,8
20
- feldera-0.37.0.dist-info/RECORD,,
17
+ feldera-0.39.0.dist-info/METADATA,sha256=OG5kS-vH0Bgaz_mNCo8V3sl-JumgW1w46kciH0GL834,2582
18
+ feldera-0.39.0.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
19
+ feldera-0.39.0.dist-info/top_level.txt,sha256=fB6yTqrQiO6RCbY1xP2T_mpPoTjDFtJvkJJodiee7d0,8
20
+ feldera-0.39.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (76.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5