athena-intelligence 0.1.24__py3-none-any.whl → 0.1.25__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.
- athena/base_client.py +112 -0
- athena/core/__init__.py +3 -0
- athena/core/client_wrapper.py +5 -3
- athena/core/http_client.py +125 -0
- athena/core/request_options.py +3 -0
- athena/dataset/client.py +4 -0
- athena/message/client.py +10 -2
- athena/report/client.py +4 -0
- athena/snippet/client.py +4 -0
- athena/sql/client.py +4 -0
- {athena_intelligence-0.1.24.dist-info → athena_intelligence-0.1.25.dist-info}/METADATA +1 -1
- {athena_intelligence-0.1.24.dist-info → athena_intelligence-0.1.25.dist-info}/RECORD +13 -11
- {athena_intelligence-0.1.24.dist-info → athena_intelligence-0.1.25.dist-info}/WHEEL +0 -0
athena/base_client.py
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import typing
|
4
|
+
|
5
|
+
import httpx
|
6
|
+
|
7
|
+
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
8
|
+
from .dataset.client import AsyncDatasetClient, DatasetClient
|
9
|
+
from .environment import AthenaEnvironment
|
10
|
+
from .message.client import AsyncMessageClient, MessageClient
|
11
|
+
from .report.client import AsyncReportClient, ReportClient
|
12
|
+
from .snippet.client import AsyncSnippetClient, SnippetClient
|
13
|
+
from .sql.client import AsyncSqlClient, SqlClient
|
14
|
+
|
15
|
+
|
16
|
+
class BaseAthena:
|
17
|
+
"""
|
18
|
+
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions.
|
19
|
+
|
20
|
+
Parameters:
|
21
|
+
- base_url: typing.Optional[str]. The base url to use for requests from the client.
|
22
|
+
|
23
|
+
- environment: AthenaEnvironment. The environment to use for requests from the client. from .environment import AthenaEnvironment
|
24
|
+
|
25
|
+
Defaults to AthenaEnvironment.DEFAULT
|
26
|
+
|
27
|
+
- api_key: str.
|
28
|
+
|
29
|
+
- timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds.
|
30
|
+
|
31
|
+
- httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
|
32
|
+
---
|
33
|
+
from athena.client import Athena
|
34
|
+
|
35
|
+
client = Athena(
|
36
|
+
api_key="YOUR_API_KEY",
|
37
|
+
)
|
38
|
+
"""
|
39
|
+
|
40
|
+
def __init__(
|
41
|
+
self,
|
42
|
+
*,
|
43
|
+
base_url: typing.Optional[str] = None,
|
44
|
+
environment: AthenaEnvironment = AthenaEnvironment.DEFAULT,
|
45
|
+
api_key: str,
|
46
|
+
timeout: typing.Optional[float] = 60,
|
47
|
+
httpx_client: typing.Optional[httpx.Client] = None
|
48
|
+
):
|
49
|
+
self._client_wrapper = SyncClientWrapper(
|
50
|
+
base_url=_get_base_url(base_url=base_url, environment=environment),
|
51
|
+
api_key=api_key,
|
52
|
+
httpx_client=httpx.Client(timeout=timeout) if httpx_client is None else httpx_client,
|
53
|
+
)
|
54
|
+
self.message = MessageClient(client_wrapper=self._client_wrapper)
|
55
|
+
self.dataset = DatasetClient(client_wrapper=self._client_wrapper)
|
56
|
+
self.snippet = SnippetClient(client_wrapper=self._client_wrapper)
|
57
|
+
self.report = ReportClient(client_wrapper=self._client_wrapper)
|
58
|
+
self.sql = SqlClient(client_wrapper=self._client_wrapper)
|
59
|
+
|
60
|
+
|
61
|
+
class AsyncBaseAthena:
|
62
|
+
"""
|
63
|
+
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions.
|
64
|
+
|
65
|
+
Parameters:
|
66
|
+
- base_url: typing.Optional[str]. The base url to use for requests from the client.
|
67
|
+
|
68
|
+
- environment: AthenaEnvironment. The environment to use for requests from the client. from .environment import AthenaEnvironment
|
69
|
+
|
70
|
+
Defaults to AthenaEnvironment.DEFAULT
|
71
|
+
|
72
|
+
- api_key: str.
|
73
|
+
|
74
|
+
- timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds.
|
75
|
+
|
76
|
+
- httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
|
77
|
+
---
|
78
|
+
from athena.client import AsyncAthena
|
79
|
+
|
80
|
+
client = AsyncAthena(
|
81
|
+
api_key="YOUR_API_KEY",
|
82
|
+
)
|
83
|
+
"""
|
84
|
+
|
85
|
+
def __init__(
|
86
|
+
self,
|
87
|
+
*,
|
88
|
+
base_url: typing.Optional[str] = None,
|
89
|
+
environment: AthenaEnvironment = AthenaEnvironment.DEFAULT,
|
90
|
+
api_key: str,
|
91
|
+
timeout: typing.Optional[float] = 60,
|
92
|
+
httpx_client: typing.Optional[httpx.AsyncClient] = None
|
93
|
+
):
|
94
|
+
self._client_wrapper = AsyncClientWrapper(
|
95
|
+
base_url=_get_base_url(base_url=base_url, environment=environment),
|
96
|
+
api_key=api_key,
|
97
|
+
httpx_client=httpx.AsyncClient(timeout=timeout) if httpx_client is None else httpx_client,
|
98
|
+
)
|
99
|
+
self.message = AsyncMessageClient(client_wrapper=self._client_wrapper)
|
100
|
+
self.dataset = AsyncDatasetClient(client_wrapper=self._client_wrapper)
|
101
|
+
self.snippet = AsyncSnippetClient(client_wrapper=self._client_wrapper)
|
102
|
+
self.report = AsyncReportClient(client_wrapper=self._client_wrapper)
|
103
|
+
self.sql = AsyncSqlClient(client_wrapper=self._client_wrapper)
|
104
|
+
|
105
|
+
|
106
|
+
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: AthenaEnvironment) -> str:
|
107
|
+
if base_url is not None:
|
108
|
+
return base_url
|
109
|
+
elif environment is not None:
|
110
|
+
return environment.value
|
111
|
+
else:
|
112
|
+
raise Exception("Please pass in either base_url or environment to construct the client")
|
athena/core/__init__.py
CHANGED
@@ -4,6 +4,7 @@ from .api_error import ApiError
|
|
4
4
|
from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper
|
5
5
|
from .datetime_utils import serialize_datetime
|
6
6
|
from .file import File, convert_file_dict_to_httpx_tuples
|
7
|
+
from .http_client import AsyncHttpClient, HttpClient
|
7
8
|
from .jsonable_encoder import jsonable_encoder
|
8
9
|
from .remove_none_from_dict import remove_none_from_dict
|
9
10
|
from .request_options import RequestOptions
|
@@ -11,8 +12,10 @@ from .request_options import RequestOptions
|
|
11
12
|
__all__ = [
|
12
13
|
"ApiError",
|
13
14
|
"AsyncClientWrapper",
|
15
|
+
"AsyncHttpClient",
|
14
16
|
"BaseClientWrapper",
|
15
17
|
"File",
|
18
|
+
"HttpClient",
|
16
19
|
"RequestOptions",
|
17
20
|
"SyncClientWrapper",
|
18
21
|
"convert_file_dict_to_httpx_tuples",
|
athena/core/client_wrapper.py
CHANGED
@@ -4,6 +4,8 @@ import typing
|
|
4
4
|
|
5
5
|
import httpx
|
6
6
|
|
7
|
+
from .http_client import AsyncHttpClient, HttpClient
|
8
|
+
|
7
9
|
|
8
10
|
class BaseClientWrapper:
|
9
11
|
def __init__(self, *, api_key: str, base_url: str):
|
@@ -14,7 +16,7 @@ class BaseClientWrapper:
|
|
14
16
|
headers: typing.Dict[str, str] = {
|
15
17
|
"X-Fern-Language": "Python",
|
16
18
|
"X-Fern-SDK-Name": "athena-intelligence",
|
17
|
-
"X-Fern-SDK-Version": "0.1.
|
19
|
+
"X-Fern-SDK-Version": "0.1.25",
|
18
20
|
}
|
19
21
|
headers["X-API-KEY"] = self.api_key
|
20
22
|
return headers
|
@@ -26,10 +28,10 @@ class BaseClientWrapper:
|
|
26
28
|
class SyncClientWrapper(BaseClientWrapper):
|
27
29
|
def __init__(self, *, api_key: str, base_url: str, httpx_client: httpx.Client):
|
28
30
|
super().__init__(api_key=api_key, base_url=base_url)
|
29
|
-
self.httpx_client = httpx_client
|
31
|
+
self.httpx_client = HttpClient(httpx_client=httpx_client)
|
30
32
|
|
31
33
|
|
32
34
|
class AsyncClientWrapper(BaseClientWrapper):
|
33
35
|
def __init__(self, *, api_key: str, base_url: str, httpx_client: httpx.AsyncClient):
|
34
36
|
super().__init__(api_key=api_key, base_url=base_url)
|
35
|
-
self.httpx_client = httpx_client
|
37
|
+
self.httpx_client = AsyncHttpClient(httpx_client=httpx_client)
|
@@ -0,0 +1,125 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import asyncio
|
4
|
+
import email.utils
|
5
|
+
import re
|
6
|
+
import time
|
7
|
+
import typing
|
8
|
+
from functools import wraps
|
9
|
+
from random import random
|
10
|
+
|
11
|
+
import httpx
|
12
|
+
|
13
|
+
INITIAL_RETRY_DELAY_SECONDS = 0.5
|
14
|
+
MAX_RETRY_DELAY_SECONDS = 10
|
15
|
+
MAX_RETRY_DELAY_SECONDS_FROM_HEADER = 30
|
16
|
+
|
17
|
+
|
18
|
+
def _parse_retry_after(response_headers: httpx.Headers) -> typing.Optional[float]:
|
19
|
+
"""
|
20
|
+
This function parses the `Retry-After` header in a HTTP response and returns the number of seconds to wait.
|
21
|
+
|
22
|
+
Inspired by the urllib3 retry implementation.
|
23
|
+
"""
|
24
|
+
retry_after_ms = response_headers.get("retry-after-ms")
|
25
|
+
if retry_after_ms is not None:
|
26
|
+
try:
|
27
|
+
return int(retry_after_ms) / 1000 if retry_after_ms > 0 else 0
|
28
|
+
except Exception:
|
29
|
+
pass
|
30
|
+
|
31
|
+
retry_after = response_headers.get("retry-after")
|
32
|
+
if retry_after is None:
|
33
|
+
return None
|
34
|
+
|
35
|
+
# Attempt to parse the header as an int.
|
36
|
+
if re.match(r"^\s*[0-9]+\s*$", retry_after):
|
37
|
+
seconds = float(retry_after)
|
38
|
+
# Fallback to parsing it as a date.
|
39
|
+
else:
|
40
|
+
retry_date_tuple = email.utils.parsedate_tz(retry_after)
|
41
|
+
if retry_date_tuple is None:
|
42
|
+
return None
|
43
|
+
if retry_date_tuple[9] is None: # Python 2
|
44
|
+
# Assume UTC if no timezone was specified
|
45
|
+
# On Python2.7, parsedate_tz returns None for a timezone offset
|
46
|
+
# instead of 0 if no timezone is given, where mktime_tz treats
|
47
|
+
# a None timezone offset as local time.
|
48
|
+
retry_date_tuple = retry_date_tuple[:9] + (0,) + retry_date_tuple[10:]
|
49
|
+
|
50
|
+
retry_date = email.utils.mktime_tz(retry_date_tuple)
|
51
|
+
seconds = retry_date - time.time()
|
52
|
+
|
53
|
+
if seconds < 0:
|
54
|
+
seconds = 0
|
55
|
+
|
56
|
+
return seconds
|
57
|
+
|
58
|
+
|
59
|
+
def _retry_timeout(response: httpx.Response, retries: int) -> float:
|
60
|
+
"""
|
61
|
+
Determine the amount of time to wait before retrying a request.
|
62
|
+
This function begins by trying to parse a retry-after header from the response, and then proceeds to use exponential backoff
|
63
|
+
with a jitter to determine the number of seconds to wait.
|
64
|
+
"""
|
65
|
+
|
66
|
+
# If the API asks us to wait a certain amount of time (and it's a reasonable amount), just do what it says.
|
67
|
+
retry_after = _parse_retry_after(response.headers)
|
68
|
+
if retry_after is not None and retry_after <= MAX_RETRY_DELAY_SECONDS_FROM_HEADER:
|
69
|
+
return retry_after
|
70
|
+
|
71
|
+
# Apply exponential backoff, capped at MAX_RETRY_DELAY_SECONDS.
|
72
|
+
retry_delay = min(INITIAL_RETRY_DELAY_SECONDS * pow(2.0, retries), MAX_RETRY_DELAY_SECONDS)
|
73
|
+
|
74
|
+
# Add a randomness / jitter to the retry delay to avoid overwhelming the server with retries.
|
75
|
+
timeout = retry_delay * (1 - 0.25 * random())
|
76
|
+
return timeout if timeout >= 0 else 0
|
77
|
+
|
78
|
+
|
79
|
+
def _should_retry(response: httpx.Response) -> bool:
|
80
|
+
retriable_400s = [429, 408, 409]
|
81
|
+
return response.status_code >= 500 or response.status_code in retriable_400s
|
82
|
+
|
83
|
+
|
84
|
+
class HttpClient:
|
85
|
+
def __init__(self, *, httpx_client: httpx.Client):
|
86
|
+
self.httpx_client = httpx_client
|
87
|
+
|
88
|
+
# Ensure that the signature of the `request` method is the same as the `httpx.Client.request` method
|
89
|
+
@wraps(httpx.Client.request)
|
90
|
+
def request(
|
91
|
+
self, *args: typing.Any, max_retries: int = 0, retries: int = 0, **kwargs: typing.Any
|
92
|
+
) -> httpx.Response:
|
93
|
+
response = self.httpx_client.request(*args, **kwargs)
|
94
|
+
if _should_retry(response=response):
|
95
|
+
if max_retries > retries:
|
96
|
+
time.sleep(_retry_timeout(response=response, retries=retries))
|
97
|
+
return self.request(max_retries=max_retries, retries=retries + 1, *args, **kwargs)
|
98
|
+
return response
|
99
|
+
|
100
|
+
@wraps(httpx.Client.stream)
|
101
|
+
def stream(self, *args: typing.Any, max_retries: int = 0, retries: int = 0, **kwargs: typing.Any) -> typing.Any:
|
102
|
+
return self.httpx_client.stream(*args, **kwargs)
|
103
|
+
|
104
|
+
|
105
|
+
class AsyncHttpClient:
|
106
|
+
def __init__(self, *, httpx_client: httpx.AsyncClient):
|
107
|
+
self.httpx_client = httpx_client
|
108
|
+
|
109
|
+
# Ensure that the signature of the `request` method is the same as the `httpx.Client.request` method
|
110
|
+
@wraps(httpx.AsyncClient.request)
|
111
|
+
async def request(
|
112
|
+
self, *args: typing.Any, max_retries: int = 0, retries: int = 0, **kwargs: typing.Any
|
113
|
+
) -> httpx.Response:
|
114
|
+
response = await self.httpx_client.request(*args, **kwargs)
|
115
|
+
if _should_retry(response=response):
|
116
|
+
if max_retries > retries:
|
117
|
+
await asyncio.sleep(_retry_timeout(response=response, retries=retries))
|
118
|
+
return await self.request(max_retries=max_retries, retries=retries + 1, *args, **kwargs)
|
119
|
+
return response
|
120
|
+
|
121
|
+
@wraps(httpx.AsyncClient.request)
|
122
|
+
async def stream(
|
123
|
+
self, *args: typing.Any, max_retries: int = 0, retries: int = 0, **kwargs: typing.Any
|
124
|
+
) -> typing.Any:
|
125
|
+
return self.httpx_client.stream(*args, **kwargs)
|
athena/core/request_options.py
CHANGED
@@ -16,6 +16,8 @@ class RequestOptions(typing.TypedDict):
|
|
16
16
|
Attributes:
|
17
17
|
- timeout_in_seconds: int. The number of seconds to await an API call before timing out.
|
18
18
|
|
19
|
+
- max_retries: int. The max number of retries to attempt if the API call fails.
|
20
|
+
|
19
21
|
- additional_headers: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's header dict
|
20
22
|
|
21
23
|
- additional_query_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's query parameters dict
|
@@ -24,6 +26,7 @@ class RequestOptions(typing.TypedDict):
|
|
24
26
|
"""
|
25
27
|
|
26
28
|
timeout_in_seconds: NotRequired[int]
|
29
|
+
max_retries: NotRequired[int]
|
27
30
|
additional_headers: NotRequired[typing.Dict[str, typing.Any]]
|
28
31
|
additional_query_parameters: NotRequired[typing.Dict[str, typing.Any]]
|
29
32
|
additional_body_parameters: NotRequired[typing.Dict[str, typing.Any]]
|
athena/dataset/client.py
CHANGED
@@ -50,6 +50,8 @@ class DatasetClient:
|
|
50
50
|
timeout=request_options.get("timeout_in_seconds")
|
51
51
|
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
52
52
|
else 60,
|
53
|
+
retries=0,
|
54
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
53
55
|
)
|
54
56
|
if 200 <= _response.status_code < 300:
|
55
57
|
return pydantic.parse_obj_as(GetDatasetsResponse, _response.json()) # type: ignore
|
@@ -93,6 +95,8 @@ class AsyncDatasetClient:
|
|
93
95
|
timeout=request_options.get("timeout_in_seconds")
|
94
96
|
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
95
97
|
else 60,
|
98
|
+
retries=0,
|
99
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
96
100
|
)
|
97
101
|
if 200 <= _response.status_code < 300:
|
98
102
|
return pydantic.parse_obj_as(GetDatasetsResponse, _response.json()) # type: ignore
|
athena/message/client.py
CHANGED
@@ -67,7 +67,7 @@ class MessageClient:
|
|
67
67
|
"""
|
68
68
|
_request: typing.Dict[str, typing.Any] = {"content": content}
|
69
69
|
if model is not OMIT:
|
70
|
-
_request["model"] = model
|
70
|
+
_request["model"] = model
|
71
71
|
if tools is not OMIT:
|
72
72
|
_request["tools"] = tools
|
73
73
|
if conversation_id is not OMIT:
|
@@ -97,6 +97,8 @@ class MessageClient:
|
|
97
97
|
timeout=request_options.get("timeout_in_seconds")
|
98
98
|
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
99
99
|
else 60,
|
100
|
+
retries=0,
|
101
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
100
102
|
)
|
101
103
|
if 200 <= _response.status_code < 300:
|
102
104
|
return pydantic.parse_obj_as(MessageOut, _response.json()) # type: ignore
|
@@ -141,6 +143,8 @@ class MessageClient:
|
|
141
143
|
timeout=request_options.get("timeout_in_seconds")
|
142
144
|
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
143
145
|
else 60,
|
146
|
+
retries=0,
|
147
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
144
148
|
)
|
145
149
|
if 200 <= _response.status_code < 300:
|
146
150
|
return pydantic.parse_obj_as(MessageOutDto, _response.json()) # type: ignore
|
@@ -195,7 +199,7 @@ class AsyncMessageClient:
|
|
195
199
|
"""
|
196
200
|
_request: typing.Dict[str, typing.Any] = {"content": content}
|
197
201
|
if model is not OMIT:
|
198
|
-
_request["model"] = model
|
202
|
+
_request["model"] = model
|
199
203
|
if tools is not OMIT:
|
200
204
|
_request["tools"] = tools
|
201
205
|
if conversation_id is not OMIT:
|
@@ -225,6 +229,8 @@ class AsyncMessageClient:
|
|
225
229
|
timeout=request_options.get("timeout_in_seconds")
|
226
230
|
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
227
231
|
else 60,
|
232
|
+
retries=0,
|
233
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
228
234
|
)
|
229
235
|
if 200 <= _response.status_code < 300:
|
230
236
|
return pydantic.parse_obj_as(MessageOut, _response.json()) # type: ignore
|
@@ -269,6 +275,8 @@ class AsyncMessageClient:
|
|
269
275
|
timeout=request_options.get("timeout_in_seconds")
|
270
276
|
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
271
277
|
else 60,
|
278
|
+
retries=0,
|
279
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
272
280
|
)
|
273
281
|
if 200 <= _response.status_code < 300:
|
274
282
|
return pydantic.parse_obj_as(MessageOutDto, _response.json()) # type: ignore
|
athena/report/client.py
CHANGED
@@ -76,6 +76,8 @@ class ReportClient:
|
|
76
76
|
timeout=request_options.get("timeout_in_seconds")
|
77
77
|
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
78
78
|
else 60,
|
79
|
+
retries=0,
|
80
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
79
81
|
)
|
80
82
|
if 200 <= _response.status_code < 300:
|
81
83
|
return pydantic.parse_obj_as(Report, _response.json()) # type: ignore
|
@@ -142,6 +144,8 @@ class AsyncReportClient:
|
|
142
144
|
timeout=request_options.get("timeout_in_seconds")
|
143
145
|
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
144
146
|
else 60,
|
147
|
+
retries=0,
|
148
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
145
149
|
)
|
146
150
|
if 200 <= _response.status_code < 300:
|
147
151
|
return pydantic.parse_obj_as(Report, _response.json()) # type: ignore
|
athena/snippet/client.py
CHANGED
@@ -50,6 +50,8 @@ class SnippetClient:
|
|
50
50
|
timeout=request_options.get("timeout_in_seconds")
|
51
51
|
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
52
52
|
else 60,
|
53
|
+
retries=0,
|
54
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
53
55
|
)
|
54
56
|
if 200 <= _response.status_code < 300:
|
55
57
|
return pydantic.parse_obj_as(GetSnippetsResponse, _response.json()) # type: ignore
|
@@ -93,6 +95,8 @@ class AsyncSnippetClient:
|
|
93
95
|
timeout=request_options.get("timeout_in_seconds")
|
94
96
|
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
95
97
|
else 60,
|
98
|
+
retries=0,
|
99
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
96
100
|
)
|
97
101
|
if 200 <= _response.status_code < 300:
|
98
102
|
return pydantic.parse_obj_as(GetSnippetsResponse, _response.json()) # type: ignore
|
athena/sql/client.py
CHANGED
@@ -70,6 +70,8 @@ class SqlClient:
|
|
70
70
|
timeout=request_options.get("timeout_in_seconds")
|
71
71
|
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
72
72
|
else 60,
|
73
|
+
retries=0,
|
74
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
73
75
|
)
|
74
76
|
if 200 <= _response.status_code < 300:
|
75
77
|
return pydantic.parse_obj_as(SqlResults, _response.json()) # type: ignore
|
@@ -130,6 +132,8 @@ class AsyncSqlClient:
|
|
130
132
|
timeout=request_options.get("timeout_in_seconds")
|
131
133
|
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
132
134
|
else 60,
|
135
|
+
retries=0,
|
136
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
133
137
|
)
|
134
138
|
if 200 <= _response.status_code < 300:
|
135
139
|
return pydantic.parse_obj_as(SqlResults, _response.json()) # type: ignore
|
@@ -1,28 +1,30 @@
|
|
1
1
|
athena/__init__.py,sha256=93_n6iw5UHLlzbN6H_LiJHsWeWu8RIA6LEB_-opfgRc,901
|
2
|
+
athena/base_client.py,sha256=RfS3KAPYhyRK8sdakv_KXJGu-jv9D6iu0iclVFbnWuE,4792
|
2
3
|
athena/client.py,sha256=nFVJkayT6k0-DeqX-Ef7eVB-VHLHEq6wsqaZHy5Pp48,4004
|
3
|
-
athena/core/__init__.py,sha256=
|
4
|
+
athena/core/__init__.py,sha256=RWfyDqkzWsf8e3VGc3NV60MovfJbg5XWzNFGB2DZ0hA,790
|
4
5
|
athena/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
5
|
-
athena/core/client_wrapper.py,sha256=
|
6
|
+
athena/core/client_wrapper.py,sha256=Inf7Leqn5tSmqObhDxR14dgeHGGysx5VKMaRRH6fDcI,1198
|
6
7
|
athena/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
7
8
|
athena/core/file.py,sha256=sy1RUGZ3aJYuw998bZytxxo6QdgKmlnlgBaMvwEKCGg,1480
|
9
|
+
athena/core/http_client.py,sha256=LI0yP3jUyE0Ue7oyBcI9nyo1pljOwh9Y5ycTeIpKwOg,4882
|
8
10
|
athena/core/jsonable_encoder.py,sha256=MTYkDov2EryHgee4QM46uZiBOuOXK9KTHlBdBwU-CpU,3799
|
9
11
|
athena/core/remove_none_from_dict.py,sha256=8m91FC3YuVem0Gm9_sXhJ2tGvP33owJJdrqCLEdowGw,330
|
10
|
-
athena/core/request_options.py,sha256
|
12
|
+
athena/core/request_options.py,sha256=-3QoOMMHI2exIyHH6Q2MD7rpo_6w-i6zMAy0nqWTN8c,1420
|
11
13
|
athena/dataset/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
12
|
-
athena/dataset/client.py,sha256=
|
14
|
+
athena/dataset/client.py,sha256=pohi3ugsXM6BKz4iN__cIKaqCLGlZDkzdaxDEgYnBLY,4472
|
13
15
|
athena/environment.py,sha256=D_CljQlUahhEi9smvMslj_5Y8gMFO6D0fRCL0ydRLuM,165
|
14
16
|
athena/errors/__init__.py,sha256=pbbVUFtB9LCocA1RMWMMF_RKjsy5YkOKX5BAuE49w6g,170
|
15
17
|
athena/errors/unprocessable_entity_error.py,sha256=FvR7XPlV3Xx5nu8HNlmLhBRdk4so_gCHjYT5PyZe6sM,313
|
16
18
|
athena/message/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
17
|
-
athena/message/client.py,sha256=
|
19
|
+
athena/message/client.py,sha256=2jSeLD6LBDTWdYIHiz_iqdB78KX-nlzqi0NRosmyTgM,12215
|
18
20
|
athena/polling_message_client.py,sha256=dmmycImvog2niEFFPo4rE5xMJHUlq9NqAr4xlFK6_Os,3998
|
19
21
|
athena/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
20
22
|
athena/report/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
21
|
-
athena/report/client.py,sha256
|
23
|
+
athena/report/client.py,sha256=sGJDrgk_E1SPleRYNhvspmsz-G3FQwMW-3alFzZPquE,6528
|
22
24
|
athena/snippet/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
23
|
-
athena/snippet/client.py,sha256=
|
25
|
+
athena/snippet/client.py,sha256=O1Q7ytPNEI4E1cGgu8Dv2oAzrGMhAEsmMb0LXOvsSSw,4472
|
24
26
|
athena/sql/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
25
|
-
athena/sql/client.py,sha256=
|
27
|
+
athena/sql/client.py,sha256=cKMrwMeBmtsKdRMSdz7b4zhTdHmNT9hAm-wI7fabvpo,6235
|
26
28
|
athena/types/__init__.py,sha256=kSz8xv8p-5znJI-sg3b6yD0E0bi9pkI1J8F60D5hu78,918
|
27
29
|
athena/types/dataset.py,sha256=LqLZn_Br9jGg4toU_6wMoZQMIgAea6Hdn11xJpgi_M8,966
|
28
30
|
athena/types/get_datasets_response.py,sha256=gikRLR9f9jQSfbMJedBh9JicH_9ccJ851nUmIZXfEvg,926
|
@@ -38,6 +40,6 @@ athena/types/status_enum.py,sha256=0UZbhdAx215GHC-U53RS98mYHtn1N3On4VBe4j02Qtc,6
|
|
38
40
|
athena/types/tools.py,sha256=Vfb-D9CYcPZH6MBATNODgfXjFyBpCs4qbkqpCMl7eBM,1277
|
39
41
|
athena/types/validation_error.py,sha256=2JhGNJouo8QpfrMBoT_JCwYSn1nFN2Nnq0p9uPLDH-U,992
|
40
42
|
athena/types/validation_error_loc_item.py,sha256=LAtjCHIllWRBFXvAZ5QZpp7CPXjdtN9EB7HrLVo6EP0,128
|
41
|
-
athena_intelligence-0.1.
|
42
|
-
athena_intelligence-0.1.
|
43
|
-
athena_intelligence-0.1.
|
43
|
+
athena_intelligence-0.1.25.dist-info/METADATA,sha256=N08JQ0f2xD8SqIOdWbVJW5jrX3f5HGot_zuN3XmaeL4,4738
|
44
|
+
athena_intelligence-0.1.25.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
45
|
+
athena_intelligence-0.1.25.dist-info/RECORD,,
|
File without changes
|