athena-intelligence 0.1.99__tar.gz → 0.1.101__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.
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/PKG-INFO +1 -1
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/pyproject.toml +1 -1
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/__init__.py +14 -10
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/base_client.py +3 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/core/client_wrapper.py +1 -1
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/errors/__init__.py +8 -1
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/errors/internal_server_error.py +3 -2
- athena_intelligence-0.1.101/src/athena/errors/unauthorized_error.py +9 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/errors/unprocessable_entity_error.py +3 -2
- athena_intelligence-0.1.101/src/athena/query/__init__.py +5 -0
- athena_intelligence-0.1.101/src/athena/query/client.py +240 -0
- athena_intelligence-0.1.101/src/athena/query/types/__init__.py +5 -0
- athena_intelligence-0.1.101/src/athena/query/types/query_execute_request_database_asset_ids.py +5 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/tools/client.py +6 -16
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/types/__init__.py +2 -8
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/types/data_frame_request_out.py +1 -1
- athena_intelligence-0.1.99/src/athena/types/data_frame_parsing_error.py → athena_intelligence-0.1.101/src/athena/types/sql_unauthorized_error.py +1 -4
- athena_intelligence-0.1.99/src/athena/types/http_validation_error.py +0 -30
- athena_intelligence-0.1.99/src/athena/types/validation_error.py +0 -32
- athena_intelligence-0.1.99/src/athena/types/validation_error_loc_item.py +0 -5
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/README.md +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/client.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/core/__init__.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/core/api_error.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/core/datetime_utils.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/core/file.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/core/http_client.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/core/jsonable_encoder.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/core/pydantic_utilities.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/core/query_encoder.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/core/remove_none_from_dict.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/core/request_options.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/environment.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/errors/not_found_error.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/errors/unsupported_media_type_error.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/py.typed +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/tools/__init__.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/tools/types/__init__.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/tools/types/tools_data_frame_request_columns_item.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/types/data_frame_request_out_columns_item.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/types/data_frame_request_out_data_item_item.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/types/data_frame_request_out_index_item.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/types/data_frame_unknown_format_error.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/types/file_fetch_error.py +0 -0
- {athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/version.py +0 -0
@@ -1,40 +1,44 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
3
|
from .types import (
|
4
|
-
DataFrameParsingError,
|
5
4
|
DataFrameRequestOut,
|
6
5
|
DataFrameRequestOutColumnsItem,
|
7
6
|
DataFrameRequestOutDataItemItem,
|
8
7
|
DataFrameRequestOutIndexItem,
|
9
8
|
DataFrameUnknownFormatError,
|
10
9
|
FileFetchError,
|
11
|
-
|
12
|
-
ValidationError,
|
13
|
-
ValidationErrorLocItem,
|
10
|
+
SqlUnauthorizedError,
|
14
11
|
)
|
15
|
-
from .errors import
|
16
|
-
|
12
|
+
from .errors import (
|
13
|
+
InternalServerError,
|
14
|
+
NotFoundError,
|
15
|
+
UnauthorizedError,
|
16
|
+
UnprocessableEntityError,
|
17
|
+
UnsupportedMediaTypeError,
|
18
|
+
)
|
19
|
+
from . import query, tools
|
17
20
|
from .environment import AthenaEnvironment
|
21
|
+
from .query import QueryExecuteRequestDatabaseAssetIds
|
18
22
|
from .tools import ToolsDataFrameRequestColumnsItem
|
19
23
|
from .version import __version__
|
20
24
|
|
21
25
|
__all__ = [
|
22
26
|
"AthenaEnvironment",
|
23
|
-
"DataFrameParsingError",
|
24
27
|
"DataFrameRequestOut",
|
25
28
|
"DataFrameRequestOutColumnsItem",
|
26
29
|
"DataFrameRequestOutDataItemItem",
|
27
30
|
"DataFrameRequestOutIndexItem",
|
28
31
|
"DataFrameUnknownFormatError",
|
29
32
|
"FileFetchError",
|
30
|
-
"HttpValidationError",
|
31
33
|
"InternalServerError",
|
32
34
|
"NotFoundError",
|
35
|
+
"QueryExecuteRequestDatabaseAssetIds",
|
36
|
+
"SqlUnauthorizedError",
|
33
37
|
"ToolsDataFrameRequestColumnsItem",
|
38
|
+
"UnauthorizedError",
|
34
39
|
"UnprocessableEntityError",
|
35
40
|
"UnsupportedMediaTypeError",
|
36
|
-
"ValidationError",
|
37
|
-
"ValidationErrorLocItem",
|
38
41
|
"__version__",
|
42
|
+
"query",
|
39
43
|
"tools",
|
40
44
|
]
|
@@ -6,6 +6,7 @@ import httpx
|
|
6
6
|
|
7
7
|
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
8
8
|
from .environment import AthenaEnvironment
|
9
|
+
from .query.client import AsyncQueryClient, QueryClient
|
9
10
|
from .tools.client import AsyncToolsClient, ToolsClient
|
10
11
|
|
11
12
|
|
@@ -67,6 +68,7 @@ class BaseAthena:
|
|
67
68
|
else httpx.Client(timeout=_defaulted_timeout),
|
68
69
|
timeout=_defaulted_timeout,
|
69
70
|
)
|
71
|
+
self.query = QueryClient(client_wrapper=self._client_wrapper)
|
70
72
|
self.tools = ToolsClient(client_wrapper=self._client_wrapper)
|
71
73
|
|
72
74
|
|
@@ -128,6 +130,7 @@ class AsyncBaseAthena:
|
|
128
130
|
else httpx.AsyncClient(timeout=_defaulted_timeout),
|
129
131
|
timeout=_defaulted_timeout,
|
130
132
|
)
|
133
|
+
self.query = AsyncQueryClient(client_wrapper=self._client_wrapper)
|
131
134
|
self.tools = AsyncToolsClient(client_wrapper=self._client_wrapper)
|
132
135
|
|
133
136
|
|
{athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/core/client_wrapper.py
RENAMED
@@ -17,7 +17,7 @@ class BaseClientWrapper:
|
|
17
17
|
headers: typing.Dict[str, str] = {
|
18
18
|
"X-Fern-Language": "Python",
|
19
19
|
"X-Fern-SDK-Name": "athena-intelligence",
|
20
|
-
"X-Fern-SDK-Version": "0.1.
|
20
|
+
"X-Fern-SDK-Version": "0.1.101",
|
21
21
|
}
|
22
22
|
headers["X-API-KEY"] = self.api_key
|
23
23
|
return headers
|
@@ -2,7 +2,14 @@
|
|
2
2
|
|
3
3
|
from .internal_server_error import InternalServerError
|
4
4
|
from .not_found_error import NotFoundError
|
5
|
+
from .unauthorized_error import UnauthorizedError
|
5
6
|
from .unprocessable_entity_error import UnprocessableEntityError
|
6
7
|
from .unsupported_media_type_error import UnsupportedMediaTypeError
|
7
8
|
|
8
|
-
__all__ = [
|
9
|
+
__all__ = [
|
10
|
+
"InternalServerError",
|
11
|
+
"NotFoundError",
|
12
|
+
"UnauthorizedError",
|
13
|
+
"UnprocessableEntityError",
|
14
|
+
"UnsupportedMediaTypeError",
|
15
|
+
]
|
@@ -1,9 +1,10 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
+
import typing
|
4
|
+
|
3
5
|
from ..core.api_error import ApiError
|
4
|
-
from ..types.data_frame_parsing_error import DataFrameParsingError
|
5
6
|
|
6
7
|
|
7
8
|
class InternalServerError(ApiError):
|
8
|
-
def __init__(self, body:
|
9
|
+
def __init__(self, body: typing.Any):
|
9
10
|
super().__init__(status_code=500, body=body)
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
from ..core.api_error import ApiError
|
4
|
+
from ..types.sql_unauthorized_error import SqlUnauthorizedError
|
5
|
+
|
6
|
+
|
7
|
+
class UnauthorizedError(ApiError):
|
8
|
+
def __init__(self, body: SqlUnauthorizedError):
|
9
|
+
super().__init__(status_code=401, body=body)
|
@@ -1,9 +1,10 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
+
import typing
|
4
|
+
|
3
5
|
from ..core.api_error import ApiError
|
4
|
-
from ..types.http_validation_error import HttpValidationError
|
5
6
|
|
6
7
|
|
7
8
|
class UnprocessableEntityError(ApiError):
|
8
|
-
def __init__(self, body:
|
9
|
+
def __init__(self, body: typing.Any):
|
9
10
|
super().__init__(status_code=422, body=body)
|
@@ -0,0 +1,240 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import typing
|
4
|
+
from json.decoder import JSONDecodeError
|
5
|
+
|
6
|
+
from ..core.api_error import ApiError
|
7
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
8
|
+
from ..core.jsonable_encoder import jsonable_encoder
|
9
|
+
from ..core.pydantic_utilities import pydantic_v1
|
10
|
+
from ..core.request_options import RequestOptions
|
11
|
+
from ..errors.internal_server_error import InternalServerError
|
12
|
+
from ..errors.unauthorized_error import UnauthorizedError
|
13
|
+
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
14
|
+
from ..types.data_frame_request_out import DataFrameRequestOut
|
15
|
+
from ..types.sql_unauthorized_error import SqlUnauthorizedError
|
16
|
+
from .types.query_execute_request_database_asset_ids import QueryExecuteRequestDatabaseAssetIds
|
17
|
+
|
18
|
+
|
19
|
+
class QueryClient:
|
20
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
21
|
+
self._client_wrapper = client_wrapper
|
22
|
+
|
23
|
+
def execute(
|
24
|
+
self,
|
25
|
+
*,
|
26
|
+
sql_command: str,
|
27
|
+
database_asset_ids: QueryExecuteRequestDatabaseAssetIds,
|
28
|
+
request_options: typing.Optional[RequestOptions] = None
|
29
|
+
) -> DataFrameRequestOut:
|
30
|
+
"""
|
31
|
+
Get the result of an SQL query over given assets.
|
32
|
+
|
33
|
+
Parameters
|
34
|
+
----------
|
35
|
+
sql_command : str
|
36
|
+
SQL query string
|
37
|
+
|
38
|
+
database_asset_ids : QueryExecuteRequestDatabaseAssetIds
|
39
|
+
Single ID or list of asset IDs
|
40
|
+
|
41
|
+
request_options : typing.Optional[RequestOptions]
|
42
|
+
Request-specific configuration.
|
43
|
+
|
44
|
+
Returns
|
45
|
+
-------
|
46
|
+
DataFrameRequestOut
|
47
|
+
Successful Response
|
48
|
+
|
49
|
+
Examples
|
50
|
+
--------
|
51
|
+
from athena.client import Athena
|
52
|
+
|
53
|
+
client = Athena(
|
54
|
+
api_key="YOUR_API_KEY",
|
55
|
+
)
|
56
|
+
client.query.execute(
|
57
|
+
sql_command="sql_command",
|
58
|
+
database_asset_ids="database_asset_ids",
|
59
|
+
)
|
60
|
+
"""
|
61
|
+
_response = self._client_wrapper.httpx_client.request(
|
62
|
+
"api/v0/query/sql/code/execute",
|
63
|
+
method="GET",
|
64
|
+
params={"sql_command": sql_command, "database_asset_ids": jsonable_encoder(database_asset_ids)},
|
65
|
+
request_options=request_options,
|
66
|
+
)
|
67
|
+
if 200 <= _response.status_code < 300:
|
68
|
+
return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
|
69
|
+
if _response.status_code == 401:
|
70
|
+
raise UnauthorizedError(pydantic_v1.parse_obj_as(SqlUnauthorizedError, _response.json())) # type: ignore
|
71
|
+
if _response.status_code == 422:
|
72
|
+
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
73
|
+
if _response.status_code == 500:
|
74
|
+
raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
75
|
+
try:
|
76
|
+
_response_json = _response.json()
|
77
|
+
except JSONDecodeError:
|
78
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
79
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
80
|
+
|
81
|
+
def execute_snippet(
|
82
|
+
self, *, snippet_asset_id: str, request_options: typing.Optional[RequestOptions] = None
|
83
|
+
) -> DataFrameRequestOut:
|
84
|
+
"""
|
85
|
+
Get the result of an SQL query over given assets.
|
86
|
+
|
87
|
+
Parameters
|
88
|
+
----------
|
89
|
+
snippet_asset_id : str
|
90
|
+
|
91
|
+
request_options : typing.Optional[RequestOptions]
|
92
|
+
Request-specific configuration.
|
93
|
+
|
94
|
+
Returns
|
95
|
+
-------
|
96
|
+
DataFrameRequestOut
|
97
|
+
Successful Response
|
98
|
+
|
99
|
+
Examples
|
100
|
+
--------
|
101
|
+
from athena.client import Athena
|
102
|
+
|
103
|
+
client = Athena(
|
104
|
+
api_key="YOUR_API_KEY",
|
105
|
+
)
|
106
|
+
client.query.execute_snippet(
|
107
|
+
snippet_asset_id="snippet_asset_id",
|
108
|
+
)
|
109
|
+
"""
|
110
|
+
_response = self._client_wrapper.httpx_client.request(
|
111
|
+
"api/v0/query/sql/snippet/execute",
|
112
|
+
method="GET",
|
113
|
+
params={"snippet_asset_id": snippet_asset_id},
|
114
|
+
request_options=request_options,
|
115
|
+
)
|
116
|
+
if 200 <= _response.status_code < 300:
|
117
|
+
return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
|
118
|
+
if _response.status_code == 401:
|
119
|
+
raise UnauthorizedError(pydantic_v1.parse_obj_as(SqlUnauthorizedError, _response.json())) # type: ignore
|
120
|
+
if _response.status_code == 422:
|
121
|
+
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
122
|
+
if _response.status_code == 500:
|
123
|
+
raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
124
|
+
try:
|
125
|
+
_response_json = _response.json()
|
126
|
+
except JSONDecodeError:
|
127
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
128
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
129
|
+
|
130
|
+
|
131
|
+
class AsyncQueryClient:
|
132
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
133
|
+
self._client_wrapper = client_wrapper
|
134
|
+
|
135
|
+
async def execute(
|
136
|
+
self,
|
137
|
+
*,
|
138
|
+
sql_command: str,
|
139
|
+
database_asset_ids: QueryExecuteRequestDatabaseAssetIds,
|
140
|
+
request_options: typing.Optional[RequestOptions] = None
|
141
|
+
) -> DataFrameRequestOut:
|
142
|
+
"""
|
143
|
+
Get the result of an SQL query over given assets.
|
144
|
+
|
145
|
+
Parameters
|
146
|
+
----------
|
147
|
+
sql_command : str
|
148
|
+
SQL query string
|
149
|
+
|
150
|
+
database_asset_ids : QueryExecuteRequestDatabaseAssetIds
|
151
|
+
Single ID or list of asset IDs
|
152
|
+
|
153
|
+
request_options : typing.Optional[RequestOptions]
|
154
|
+
Request-specific configuration.
|
155
|
+
|
156
|
+
Returns
|
157
|
+
-------
|
158
|
+
DataFrameRequestOut
|
159
|
+
Successful Response
|
160
|
+
|
161
|
+
Examples
|
162
|
+
--------
|
163
|
+
from athena.client import AsyncAthena
|
164
|
+
|
165
|
+
client = AsyncAthena(
|
166
|
+
api_key="YOUR_API_KEY",
|
167
|
+
)
|
168
|
+
await client.query.execute(
|
169
|
+
sql_command="sql_command",
|
170
|
+
database_asset_ids="database_asset_ids",
|
171
|
+
)
|
172
|
+
"""
|
173
|
+
_response = await self._client_wrapper.httpx_client.request(
|
174
|
+
"api/v0/query/sql/code/execute",
|
175
|
+
method="GET",
|
176
|
+
params={"sql_command": sql_command, "database_asset_ids": jsonable_encoder(database_asset_ids)},
|
177
|
+
request_options=request_options,
|
178
|
+
)
|
179
|
+
if 200 <= _response.status_code < 300:
|
180
|
+
return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
|
181
|
+
if _response.status_code == 401:
|
182
|
+
raise UnauthorizedError(pydantic_v1.parse_obj_as(SqlUnauthorizedError, _response.json())) # type: ignore
|
183
|
+
if _response.status_code == 422:
|
184
|
+
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
185
|
+
if _response.status_code == 500:
|
186
|
+
raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
187
|
+
try:
|
188
|
+
_response_json = _response.json()
|
189
|
+
except JSONDecodeError:
|
190
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
191
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
192
|
+
|
193
|
+
async def execute_snippet(
|
194
|
+
self, *, snippet_asset_id: str, request_options: typing.Optional[RequestOptions] = None
|
195
|
+
) -> DataFrameRequestOut:
|
196
|
+
"""
|
197
|
+
Get the result of an SQL query over given assets.
|
198
|
+
|
199
|
+
Parameters
|
200
|
+
----------
|
201
|
+
snippet_asset_id : str
|
202
|
+
|
203
|
+
request_options : typing.Optional[RequestOptions]
|
204
|
+
Request-specific configuration.
|
205
|
+
|
206
|
+
Returns
|
207
|
+
-------
|
208
|
+
DataFrameRequestOut
|
209
|
+
Successful Response
|
210
|
+
|
211
|
+
Examples
|
212
|
+
--------
|
213
|
+
from athena.client import AsyncAthena
|
214
|
+
|
215
|
+
client = AsyncAthena(
|
216
|
+
api_key="YOUR_API_KEY",
|
217
|
+
)
|
218
|
+
await client.query.execute_snippet(
|
219
|
+
snippet_asset_id="snippet_asset_id",
|
220
|
+
)
|
221
|
+
"""
|
222
|
+
_response = await self._client_wrapper.httpx_client.request(
|
223
|
+
"api/v0/query/sql/snippet/execute",
|
224
|
+
method="GET",
|
225
|
+
params={"snippet_asset_id": snippet_asset_id},
|
226
|
+
request_options=request_options,
|
227
|
+
)
|
228
|
+
if 200 <= _response.status_code < 300:
|
229
|
+
return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
|
230
|
+
if _response.status_code == 401:
|
231
|
+
raise UnauthorizedError(pydantic_v1.parse_obj_as(SqlUnauthorizedError, _response.json())) # type: ignore
|
232
|
+
if _response.status_code == 422:
|
233
|
+
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
234
|
+
if _response.status_code == 500:
|
235
|
+
raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
236
|
+
try:
|
237
|
+
_response_json = _response.json()
|
238
|
+
except JSONDecodeError:
|
239
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
240
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
@@ -11,11 +11,9 @@ from ..errors.internal_server_error import InternalServerError
|
|
11
11
|
from ..errors.not_found_error import NotFoundError
|
12
12
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
13
13
|
from ..errors.unsupported_media_type_error import UnsupportedMediaTypeError
|
14
|
-
from ..types.data_frame_parsing_error import DataFrameParsingError
|
15
14
|
from ..types.data_frame_request_out import DataFrameRequestOut
|
16
15
|
from ..types.data_frame_unknown_format_error import DataFrameUnknownFormatError
|
17
16
|
from ..types.file_fetch_error import FileFetchError
|
18
|
-
from ..types.http_validation_error import HttpValidationError
|
19
17
|
from .types.tools_data_frame_request_columns_item import ToolsDataFrameRequestColumnsItem
|
20
18
|
|
21
19
|
|
@@ -95,11 +93,9 @@ class ToolsClient:
|
|
95
93
|
pydantic_v1.parse_obj_as(DataFrameUnknownFormatError, _response.json()) # type: ignore
|
96
94
|
)
|
97
95
|
if _response.status_code == 422:
|
98
|
-
raise UnprocessableEntityError(
|
99
|
-
pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
|
100
|
-
)
|
96
|
+
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
101
97
|
if _response.status_code == 500:
|
102
|
-
raise InternalServerError(pydantic_v1.parse_obj_as(
|
98
|
+
raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
103
99
|
try:
|
104
100
|
_response_json = _response.json()
|
105
101
|
except JSONDecodeError:
|
@@ -146,9 +142,7 @@ class ToolsClient:
|
|
146
142
|
if _response.status_code == 404:
|
147
143
|
raise NotFoundError(pydantic_v1.parse_obj_as(FileFetchError, _response.json())) # type: ignore
|
148
144
|
if _response.status_code == 422:
|
149
|
-
raise UnprocessableEntityError(
|
150
|
-
pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
|
151
|
-
)
|
145
|
+
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
152
146
|
try:
|
153
147
|
_response_json = _response.json()
|
154
148
|
except JSONDecodeError:
|
@@ -232,11 +226,9 @@ class AsyncToolsClient:
|
|
232
226
|
pydantic_v1.parse_obj_as(DataFrameUnknownFormatError, _response.json()) # type: ignore
|
233
227
|
)
|
234
228
|
if _response.status_code == 422:
|
235
|
-
raise UnprocessableEntityError(
|
236
|
-
pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
|
237
|
-
)
|
229
|
+
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
238
230
|
if _response.status_code == 500:
|
239
|
-
raise InternalServerError(pydantic_v1.parse_obj_as(
|
231
|
+
raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
240
232
|
try:
|
241
233
|
_response_json = _response.json()
|
242
234
|
except JSONDecodeError:
|
@@ -283,9 +275,7 @@ class AsyncToolsClient:
|
|
283
275
|
if _response.status_code == 404:
|
284
276
|
raise NotFoundError(pydantic_v1.parse_obj_as(FileFetchError, _response.json())) # type: ignore
|
285
277
|
if _response.status_code == 422:
|
286
|
-
raise UnprocessableEntityError(
|
287
|
-
pydantic_v1.parse_obj_as(HttpValidationError, _response.json()) # type: ignore
|
288
|
-
)
|
278
|
+
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
289
279
|
try:
|
290
280
|
_response_json = _response.json()
|
291
281
|
except JSONDecodeError:
|
@@ -1,25 +1,19 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from .data_frame_parsing_error import DataFrameParsingError
|
4
3
|
from .data_frame_request_out import DataFrameRequestOut
|
5
4
|
from .data_frame_request_out_columns_item import DataFrameRequestOutColumnsItem
|
6
5
|
from .data_frame_request_out_data_item_item import DataFrameRequestOutDataItemItem
|
7
6
|
from .data_frame_request_out_index_item import DataFrameRequestOutIndexItem
|
8
7
|
from .data_frame_unknown_format_error import DataFrameUnknownFormatError
|
9
8
|
from .file_fetch_error import FileFetchError
|
10
|
-
from .
|
11
|
-
from .validation_error import ValidationError
|
12
|
-
from .validation_error_loc_item import ValidationErrorLocItem
|
9
|
+
from .sql_unauthorized_error import SqlUnauthorizedError
|
13
10
|
|
14
11
|
__all__ = [
|
15
|
-
"DataFrameParsingError",
|
16
12
|
"DataFrameRequestOut",
|
17
13
|
"DataFrameRequestOutColumnsItem",
|
18
14
|
"DataFrameRequestOutDataItemItem",
|
19
15
|
"DataFrameRequestOutIndexItem",
|
20
16
|
"DataFrameUnknownFormatError",
|
21
17
|
"FileFetchError",
|
22
|
-
"
|
23
|
-
"ValidationError",
|
24
|
-
"ValidationErrorLocItem",
|
18
|
+
"SqlUnauthorizedError",
|
25
19
|
]
|
@@ -17,7 +17,7 @@ class DataFrameRequestOut(pydantic_v1.BaseModel):
|
|
17
17
|
|
18
18
|
columns: typing.List[typing.Optional[DataFrameRequestOutColumnsItem]]
|
19
19
|
data: typing.List[typing.List[typing.Optional[DataFrameRequestOutDataItemItem]]]
|
20
|
-
index: typing.List[typing.Optional[DataFrameRequestOutIndexItem]]
|
20
|
+
index: typing.Optional[typing.List[typing.Optional[DataFrameRequestOutIndexItem]]] = None
|
21
21
|
|
22
22
|
def json(self, **kwargs: typing.Any) -> str:
|
23
23
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
@@ -7,10 +7,7 @@ from ..core.datetime_utils import serialize_datetime
|
|
7
7
|
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
8
8
|
|
9
9
|
|
10
|
-
class
|
11
|
-
asset_id: str
|
12
|
-
message: str
|
13
|
-
|
10
|
+
class SqlUnauthorizedError(pydantic_v1.BaseModel):
|
14
11
|
def json(self, **kwargs: typing.Any) -> str:
|
15
12
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
16
13
|
return super().json(**kwargs_with_defaults)
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
2
|
-
|
3
|
-
import datetime as dt
|
4
|
-
import typing
|
5
|
-
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
7
|
-
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
8
|
-
from .validation_error import ValidationError
|
9
|
-
|
10
|
-
|
11
|
-
class HttpValidationError(pydantic_v1.BaseModel):
|
12
|
-
detail: typing.Optional[typing.List[ValidationError]] = None
|
13
|
-
|
14
|
-
def json(self, **kwargs: typing.Any) -> str:
|
15
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
16
|
-
return super().json(**kwargs_with_defaults)
|
17
|
-
|
18
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
19
|
-
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
20
|
-
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
21
|
-
|
22
|
-
return deep_union_pydantic_dicts(
|
23
|
-
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
24
|
-
)
|
25
|
-
|
26
|
-
class Config:
|
27
|
-
frozen = True
|
28
|
-
smart_union = True
|
29
|
-
extra = pydantic_v1.Extra.allow
|
30
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
2
|
-
|
3
|
-
import datetime as dt
|
4
|
-
import typing
|
5
|
-
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
7
|
-
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
8
|
-
from .validation_error_loc_item import ValidationErrorLocItem
|
9
|
-
|
10
|
-
|
11
|
-
class ValidationError(pydantic_v1.BaseModel):
|
12
|
-
loc: typing.List[ValidationErrorLocItem]
|
13
|
-
msg: str
|
14
|
-
type: str
|
15
|
-
|
16
|
-
def json(self, **kwargs: typing.Any) -> str:
|
17
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
18
|
-
return super().json(**kwargs_with_defaults)
|
19
|
-
|
20
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
21
|
-
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
22
|
-
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
23
|
-
|
24
|
-
return deep_union_pydantic_dicts(
|
25
|
-
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
26
|
-
)
|
27
|
-
|
28
|
-
class Config:
|
29
|
-
frozen = True
|
30
|
-
smart_union = True
|
31
|
-
extra = pydantic_v1.Extra.allow
|
32
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/core/datetime_utils.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/core/jsonable_encoder.py
RENAMED
File without changes
|
{athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/core/pydantic_utilities.py
RENAMED
File without changes
|
File without changes
|
{athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/core/remove_none_from_dict.py
RENAMED
File without changes
|
{athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/core/request_options.py
RENAMED
File without changes
|
File without changes
|
{athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/errors/not_found_error.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/tools/types/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.99 → athena_intelligence-0.1.101}/src/athena/types/file_fetch_error.py
RENAMED
File without changes
|
File without changes
|