athena-intelligence 0.1.102__tar.gz → 0.1.104__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.102 → athena_intelligence-0.1.104}/PKG-INFO +1 -1
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/pyproject.toml +1 -1
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/__init__.py +12 -4
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/client.py +2 -2
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/core/client_wrapper.py +1 -1
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/errors/__init__.py +4 -0
- athena_intelligence-0.1.104/src/athena/errors/bad_request_error.py +9 -0
- athena_intelligence-0.1.104/src/athena/errors/content_too_large_error.py +9 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/errors/not_found_error.py +2 -2
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/errors/unauthorized_error.py +3 -2
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/query/client.py +4 -5
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/tools/client.py +137 -5
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/types/__init__.py +8 -4
- athena_intelligence-0.1.102/src/athena/types/sql_unauthorized_error.py → athena_intelligence-0.1.104/src/athena/types/asset_not_found_error.py +1 -1
- athena_intelligence-0.1.102/src/athena/types/file_fetch_error.py → athena_intelligence-0.1.104/src/athena/types/file_too_large_error.py +1 -2
- athena_intelligence-0.1.104/src/athena/types/parent_folder_error.py +29 -0
- athena_intelligence-0.1.104/src/athena/types/save_asset_request_out.py +33 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/README.md +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/base_client.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/core/__init__.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/core/api_error.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/core/datetime_utils.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/core/file.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/core/http_client.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/core/jsonable_encoder.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/core/pydantic_utilities.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/core/query_encoder.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/core/remove_none_from_dict.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/core/request_options.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/environment.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/errors/internal_server_error.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/errors/unprocessable_entity_error.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/errors/unsupported_media_type_error.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/py.typed +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/query/__init__.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/query/types/__init__.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/query/types/query_execute_request_database_asset_ids.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/tools/__init__.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/tools/types/__init__.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/tools/types/tools_data_frame_request_columns_item.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/types/data_frame_request_out.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/types/data_frame_request_out_columns_item.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/types/data_frame_request_out_data_item_item.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/types/data_frame_request_out_index_item.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/types/data_frame_unknown_format_error.py +0 -0
- {athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/version.py +0 -0
@@ -1,15 +1,19 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
3
|
from .types import (
|
4
|
+
AssetNotFoundError,
|
4
5
|
DataFrameRequestOut,
|
5
6
|
DataFrameRequestOutColumnsItem,
|
6
7
|
DataFrameRequestOutDataItemItem,
|
7
8
|
DataFrameRequestOutIndexItem,
|
8
9
|
DataFrameUnknownFormatError,
|
9
|
-
|
10
|
-
|
10
|
+
FileTooLargeError,
|
11
|
+
ParentFolderError,
|
12
|
+
SaveAssetRequestOut,
|
11
13
|
)
|
12
14
|
from .errors import (
|
15
|
+
BadRequestError,
|
16
|
+
ContentTooLargeError,
|
13
17
|
InternalServerError,
|
14
18
|
NotFoundError,
|
15
19
|
UnauthorizedError,
|
@@ -23,17 +27,21 @@ from .tools import ToolsDataFrameRequestColumnsItem
|
|
23
27
|
from .version import __version__
|
24
28
|
|
25
29
|
__all__ = [
|
30
|
+
"AssetNotFoundError",
|
26
31
|
"AthenaEnvironment",
|
32
|
+
"BadRequestError",
|
33
|
+
"ContentTooLargeError",
|
27
34
|
"DataFrameRequestOut",
|
28
35
|
"DataFrameRequestOutColumnsItem",
|
29
36
|
"DataFrameRequestOutDataItemItem",
|
30
37
|
"DataFrameRequestOutIndexItem",
|
31
38
|
"DataFrameUnknownFormatError",
|
32
|
-
"
|
39
|
+
"FileTooLargeError",
|
33
40
|
"InternalServerError",
|
34
41
|
"NotFoundError",
|
42
|
+
"ParentFolderError",
|
35
43
|
"QueryExecuteRequestDatabaseAssetIds",
|
36
|
-
"
|
44
|
+
"SaveAssetRequestOut",
|
37
45
|
"ToolsDataFrameRequestColumnsItem",
|
38
46
|
"UnauthorizedError",
|
39
47
|
"UnprocessableEntityError",
|
@@ -220,7 +220,7 @@ class Athena(BaseAthena):
|
|
220
220
|
if environment == SpecialEnvironments.AUTODETECT_ENVIRONMENT:
|
221
221
|
if 'ATHENA_API_URL' in os.environ:
|
222
222
|
|
223
|
-
class AutodetectedEnvironments:
|
223
|
+
class AutodetectedEnvironments(enum.Enum):
|
224
224
|
CURRENT = os.environ['ATHENA_API_URL']
|
225
225
|
|
226
226
|
environment = cast(AthenaEnvironment, AutodetectedEnvironments.CURRENT)
|
@@ -290,7 +290,7 @@ class AsyncAthena(AsyncBaseAthena):
|
|
290
290
|
if environment == SpecialEnvironments.AUTODETECT_ENVIRONMENT:
|
291
291
|
if 'ATHENA_API_URL' in os.environ:
|
292
292
|
|
293
|
-
class AutodetectedEnvironments:
|
293
|
+
class AutodetectedEnvironments(enum.Enum):
|
294
294
|
CURRENT = os.environ['ATHENA_API_URL']
|
295
295
|
|
296
296
|
environment = cast(AthenaEnvironment, AutodetectedEnvironments.CURRENT)
|
{athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/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.104",
|
21
21
|
}
|
22
22
|
headers["X-API-KEY"] = self.api_key
|
23
23
|
return headers
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
+
from .bad_request_error import BadRequestError
|
4
|
+
from .content_too_large_error import ContentTooLargeError
|
3
5
|
from .internal_server_error import InternalServerError
|
4
6
|
from .not_found_error import NotFoundError
|
5
7
|
from .unauthorized_error import UnauthorizedError
|
@@ -7,6 +9,8 @@ from .unprocessable_entity_error import UnprocessableEntityError
|
|
7
9
|
from .unsupported_media_type_error import UnsupportedMediaTypeError
|
8
10
|
|
9
11
|
__all__ = [
|
12
|
+
"BadRequestError",
|
13
|
+
"ContentTooLargeError",
|
10
14
|
"InternalServerError",
|
11
15
|
"NotFoundError",
|
12
16
|
"UnauthorizedError",
|
@@ -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.parent_folder_error import ParentFolderError
|
5
|
+
|
6
|
+
|
7
|
+
class BadRequestError(ApiError):
|
8
|
+
def __init__(self, body: ParentFolderError):
|
9
|
+
super().__init__(status_code=400, 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.file_too_large_error import FileTooLargeError
|
5
|
+
|
6
|
+
|
7
|
+
class ContentTooLargeError(ApiError):
|
8
|
+
def __init__(self, body: FileTooLargeError):
|
9
|
+
super().__init__(status_code=413, body=body)
|
{athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/errors/not_found_error.py
RENAMED
@@ -1,9 +1,9 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
3
|
from ..core.api_error import ApiError
|
4
|
-
from ..types.
|
4
|
+
from ..types.asset_not_found_error import AssetNotFoundError
|
5
5
|
|
6
6
|
|
7
7
|
class NotFoundError(ApiError):
|
8
|
-
def __init__(self, body:
|
8
|
+
def __init__(self, body: AssetNotFoundError):
|
9
9
|
super().__init__(status_code=404, body=body)
|
{athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/errors/unauthorized_error.py
RENAMED
@@ -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.sql_unauthorized_error import SqlUnauthorizedError
|
5
6
|
|
6
7
|
|
7
8
|
class UnauthorizedError(ApiError):
|
8
|
-
def __init__(self, body:
|
9
|
+
def __init__(self, body: typing.Any):
|
9
10
|
super().__init__(status_code=401, body=body)
|
@@ -12,7 +12,6 @@ from ..errors.internal_server_error import InternalServerError
|
|
12
12
|
from ..errors.unauthorized_error import UnauthorizedError
|
13
13
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
14
14
|
from ..types.data_frame_request_out import DataFrameRequestOut
|
15
|
-
from ..types.sql_unauthorized_error import SqlUnauthorizedError
|
16
15
|
from .types.query_execute_request_database_asset_ids import QueryExecuteRequestDatabaseAssetIds
|
17
16
|
|
18
17
|
|
@@ -67,7 +66,7 @@ class QueryClient:
|
|
67
66
|
if 200 <= _response.status_code < 300:
|
68
67
|
return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
|
69
68
|
if _response.status_code == 401:
|
70
|
-
raise UnauthorizedError(pydantic_v1.parse_obj_as(
|
69
|
+
raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
71
70
|
if _response.status_code == 422:
|
72
71
|
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
73
72
|
if _response.status_code == 500:
|
@@ -116,7 +115,7 @@ class QueryClient:
|
|
116
115
|
if 200 <= _response.status_code < 300:
|
117
116
|
return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
|
118
117
|
if _response.status_code == 401:
|
119
|
-
raise UnauthorizedError(pydantic_v1.parse_obj_as(
|
118
|
+
raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
120
119
|
if _response.status_code == 422:
|
121
120
|
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
122
121
|
if _response.status_code == 500:
|
@@ -179,7 +178,7 @@ class AsyncQueryClient:
|
|
179
178
|
if 200 <= _response.status_code < 300:
|
180
179
|
return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
|
181
180
|
if _response.status_code == 401:
|
182
|
-
raise UnauthorizedError(pydantic_v1.parse_obj_as(
|
181
|
+
raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
183
182
|
if _response.status_code == 422:
|
184
183
|
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
185
184
|
if _response.status_code == 500:
|
@@ -228,7 +227,7 @@ class AsyncQueryClient:
|
|
228
227
|
if 200 <= _response.status_code < 300:
|
229
228
|
return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
|
230
229
|
if _response.status_code == 401:
|
231
|
-
raise UnauthorizedError(pydantic_v1.parse_obj_as(
|
230
|
+
raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
232
231
|
if _response.status_code == 422:
|
233
232
|
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
234
233
|
if _response.status_code == 500:
|
@@ -3,19 +3,29 @@
|
|
3
3
|
import typing
|
4
4
|
from json.decoder import JSONDecodeError
|
5
5
|
|
6
|
+
from .. import core
|
6
7
|
from ..core.api_error import ApiError
|
7
8
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
8
9
|
from ..core.pydantic_utilities import pydantic_v1
|
9
10
|
from ..core.request_options import RequestOptions
|
11
|
+
from ..errors.bad_request_error import BadRequestError
|
12
|
+
from ..errors.content_too_large_error import ContentTooLargeError
|
10
13
|
from ..errors.internal_server_error import InternalServerError
|
11
14
|
from ..errors.not_found_error import NotFoundError
|
15
|
+
from ..errors.unauthorized_error import UnauthorizedError
|
12
16
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
13
17
|
from ..errors.unsupported_media_type_error import UnsupportedMediaTypeError
|
18
|
+
from ..types.asset_not_found_error import AssetNotFoundError
|
14
19
|
from ..types.data_frame_request_out import DataFrameRequestOut
|
15
20
|
from ..types.data_frame_unknown_format_error import DataFrameUnknownFormatError
|
16
|
-
from ..types.
|
21
|
+
from ..types.file_too_large_error import FileTooLargeError
|
22
|
+
from ..types.parent_folder_error import ParentFolderError
|
23
|
+
from ..types.save_asset_request_out import SaveAssetRequestOut
|
17
24
|
from .types.tools_data_frame_request_columns_item import ToolsDataFrameRequestColumnsItem
|
18
25
|
|
26
|
+
# this is used as the default value for optional parameters
|
27
|
+
OMIT = typing.cast(typing.Any, ...)
|
28
|
+
|
19
29
|
|
20
30
|
class ToolsClient:
|
21
31
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
@@ -86,8 +96,10 @@ class ToolsClient:
|
|
86
96
|
)
|
87
97
|
if 200 <= _response.status_code < 300:
|
88
98
|
return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
|
99
|
+
if _response.status_code == 401:
|
100
|
+
raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
89
101
|
if _response.status_code == 404:
|
90
|
-
raise NotFoundError(pydantic_v1.parse_obj_as(
|
102
|
+
raise NotFoundError(pydantic_v1.parse_obj_as(AssetNotFoundError, _response.json())) # type: ignore
|
91
103
|
if _response.status_code == 415:
|
92
104
|
raise UnsupportedMediaTypeError(
|
93
105
|
pydantic_v1.parse_obj_as(DataFrameUnknownFormatError, _response.json()) # type: ignore
|
@@ -139,16 +151,75 @@ class ToolsClient:
|
|
139
151
|
yield _chunk
|
140
152
|
return
|
141
153
|
_response.read()
|
154
|
+
if _response.status_code == 401:
|
155
|
+
raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
142
156
|
if _response.status_code == 404:
|
143
|
-
raise NotFoundError(pydantic_v1.parse_obj_as(
|
157
|
+
raise NotFoundError(pydantic_v1.parse_obj_as(AssetNotFoundError, _response.json())) # type: ignore
|
144
158
|
if _response.status_code == 422:
|
145
159
|
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
160
|
+
if _response.status_code == 500:
|
161
|
+
raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
146
162
|
try:
|
147
163
|
_response_json = _response.json()
|
148
164
|
except JSONDecodeError:
|
149
165
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
150
166
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
151
167
|
|
168
|
+
def save_asset(
|
169
|
+
self,
|
170
|
+
*,
|
171
|
+
file: core.File,
|
172
|
+
parent_folder_id: typing.Optional[str] = None,
|
173
|
+
request_options: typing.Optional[RequestOptions] = None
|
174
|
+
) -> SaveAssetRequestOut:
|
175
|
+
"""
|
176
|
+
Parameters
|
177
|
+
----------
|
178
|
+
file : core.File
|
179
|
+
See core.File for more documentation
|
180
|
+
|
181
|
+
parent_folder_id : typing.Optional[str]
|
182
|
+
|
183
|
+
request_options : typing.Optional[RequestOptions]
|
184
|
+
Request-specific configuration.
|
185
|
+
|
186
|
+
Returns
|
187
|
+
-------
|
188
|
+
SaveAssetRequestOut
|
189
|
+
Successful Response
|
190
|
+
|
191
|
+
Examples
|
192
|
+
--------
|
193
|
+
from athena.client import Athena
|
194
|
+
|
195
|
+
client = Athena(
|
196
|
+
api_key="YOUR_API_KEY",
|
197
|
+
)
|
198
|
+
client.tools.save_asset()
|
199
|
+
"""
|
200
|
+
_response = self._client_wrapper.httpx_client.request(
|
201
|
+
"api/v0/tools/file/save",
|
202
|
+
method="POST",
|
203
|
+
params={"parent_folder_id": parent_folder_id},
|
204
|
+
data={},
|
205
|
+
files={"file": file},
|
206
|
+
request_options=request_options,
|
207
|
+
omit=OMIT,
|
208
|
+
)
|
209
|
+
if 200 <= _response.status_code < 300:
|
210
|
+
return pydantic_v1.parse_obj_as(SaveAssetRequestOut, _response.json()) # type: ignore
|
211
|
+
if _response.status_code == 400:
|
212
|
+
raise BadRequestError(pydantic_v1.parse_obj_as(ParentFolderError, _response.json())) # type: ignore
|
213
|
+
if _response.status_code == 413:
|
214
|
+
raise ContentTooLargeError(pydantic_v1.parse_obj_as(FileTooLargeError, _response.json())) # type: ignore
|
215
|
+
if _response.status_code == 422:
|
216
|
+
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
217
|
+
try:
|
218
|
+
_response_json = _response.json()
|
219
|
+
except JSONDecodeError:
|
220
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
221
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
222
|
+
|
152
223
|
|
153
224
|
class AsyncToolsClient:
|
154
225
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
@@ -219,8 +290,10 @@ class AsyncToolsClient:
|
|
219
290
|
)
|
220
291
|
if 200 <= _response.status_code < 300:
|
221
292
|
return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
|
293
|
+
if _response.status_code == 401:
|
294
|
+
raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
222
295
|
if _response.status_code == 404:
|
223
|
-
raise NotFoundError(pydantic_v1.parse_obj_as(
|
296
|
+
raise NotFoundError(pydantic_v1.parse_obj_as(AssetNotFoundError, _response.json())) # type: ignore
|
224
297
|
if _response.status_code == 415:
|
225
298
|
raise UnsupportedMediaTypeError(
|
226
299
|
pydantic_v1.parse_obj_as(DataFrameUnknownFormatError, _response.json()) # type: ignore
|
@@ -272,12 +345,71 @@ class AsyncToolsClient:
|
|
272
345
|
yield _chunk
|
273
346
|
return
|
274
347
|
await _response.aread()
|
348
|
+
if _response.status_code == 401:
|
349
|
+
raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
275
350
|
if _response.status_code == 404:
|
276
|
-
raise NotFoundError(pydantic_v1.parse_obj_as(
|
351
|
+
raise NotFoundError(pydantic_v1.parse_obj_as(AssetNotFoundError, _response.json())) # type: ignore
|
277
352
|
if _response.status_code == 422:
|
278
353
|
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
354
|
+
if _response.status_code == 500:
|
355
|
+
raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
279
356
|
try:
|
280
357
|
_response_json = _response.json()
|
281
358
|
except JSONDecodeError:
|
282
359
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
283
360
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
361
|
+
|
362
|
+
async def save_asset(
|
363
|
+
self,
|
364
|
+
*,
|
365
|
+
file: core.File,
|
366
|
+
parent_folder_id: typing.Optional[str] = None,
|
367
|
+
request_options: typing.Optional[RequestOptions] = None
|
368
|
+
) -> SaveAssetRequestOut:
|
369
|
+
"""
|
370
|
+
Parameters
|
371
|
+
----------
|
372
|
+
file : core.File
|
373
|
+
See core.File for more documentation
|
374
|
+
|
375
|
+
parent_folder_id : typing.Optional[str]
|
376
|
+
|
377
|
+
request_options : typing.Optional[RequestOptions]
|
378
|
+
Request-specific configuration.
|
379
|
+
|
380
|
+
Returns
|
381
|
+
-------
|
382
|
+
SaveAssetRequestOut
|
383
|
+
Successful Response
|
384
|
+
|
385
|
+
Examples
|
386
|
+
--------
|
387
|
+
from athena.client import AsyncAthena
|
388
|
+
|
389
|
+
client = AsyncAthena(
|
390
|
+
api_key="YOUR_API_KEY",
|
391
|
+
)
|
392
|
+
await client.tools.save_asset()
|
393
|
+
"""
|
394
|
+
_response = await self._client_wrapper.httpx_client.request(
|
395
|
+
"api/v0/tools/file/save",
|
396
|
+
method="POST",
|
397
|
+
params={"parent_folder_id": parent_folder_id},
|
398
|
+
data={},
|
399
|
+
files={"file": file},
|
400
|
+
request_options=request_options,
|
401
|
+
omit=OMIT,
|
402
|
+
)
|
403
|
+
if 200 <= _response.status_code < 300:
|
404
|
+
return pydantic_v1.parse_obj_as(SaveAssetRequestOut, _response.json()) # type: ignore
|
405
|
+
if _response.status_code == 400:
|
406
|
+
raise BadRequestError(pydantic_v1.parse_obj_as(ParentFolderError, _response.json())) # type: ignore
|
407
|
+
if _response.status_code == 413:
|
408
|
+
raise ContentTooLargeError(pydantic_v1.parse_obj_as(FileTooLargeError, _response.json())) # type: ignore
|
409
|
+
if _response.status_code == 422:
|
410
|
+
raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
411
|
+
try:
|
412
|
+
_response_json = _response.json()
|
413
|
+
except JSONDecodeError:
|
414
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
415
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
@@ -1,19 +1,23 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
+
from .asset_not_found_error import AssetNotFoundError
|
3
4
|
from .data_frame_request_out import DataFrameRequestOut
|
4
5
|
from .data_frame_request_out_columns_item import DataFrameRequestOutColumnsItem
|
5
6
|
from .data_frame_request_out_data_item_item import DataFrameRequestOutDataItemItem
|
6
7
|
from .data_frame_request_out_index_item import DataFrameRequestOutIndexItem
|
7
8
|
from .data_frame_unknown_format_error import DataFrameUnknownFormatError
|
8
|
-
from .
|
9
|
-
from .
|
9
|
+
from .file_too_large_error import FileTooLargeError
|
10
|
+
from .parent_folder_error import ParentFolderError
|
11
|
+
from .save_asset_request_out import SaveAssetRequestOut
|
10
12
|
|
11
13
|
__all__ = [
|
14
|
+
"AssetNotFoundError",
|
12
15
|
"DataFrameRequestOut",
|
13
16
|
"DataFrameRequestOutColumnsItem",
|
14
17
|
"DataFrameRequestOutDataItemItem",
|
15
18
|
"DataFrameRequestOutIndexItem",
|
16
19
|
"DataFrameUnknownFormatError",
|
17
|
-
"
|
18
|
-
"
|
20
|
+
"FileTooLargeError",
|
21
|
+
"ParentFolderError",
|
22
|
+
"SaveAssetRequestOut",
|
19
23
|
]
|
@@ -7,7 +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
|
10
|
+
class AssetNotFoundError(pydantic_v1.BaseModel):
|
11
11
|
message: str
|
12
12
|
|
13
13
|
def json(self, **kwargs: typing.Any) -> str:
|
@@ -7,9 +7,8 @@ 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
|
10
|
+
class FileTooLargeError(pydantic_v1.BaseModel):
|
11
11
|
message: str
|
12
|
-
status_code: typing.Optional[int] = None
|
13
12
|
|
14
13
|
def json(self, **kwargs: typing.Any) -> str:
|
15
14
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
@@ -0,0 +1,29 @@
|
|
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
|
+
|
9
|
+
|
10
|
+
class ParentFolderError(pydantic_v1.BaseModel):
|
11
|
+
message: str
|
12
|
+
|
13
|
+
def json(self, **kwargs: typing.Any) -> str:
|
14
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
15
|
+
return super().json(**kwargs_with_defaults)
|
16
|
+
|
17
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
18
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
19
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
20
|
+
|
21
|
+
return deep_union_pydantic_dicts(
|
22
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
23
|
+
)
|
24
|
+
|
25
|
+
class Config:
|
26
|
+
frozen = True
|
27
|
+
smart_union = True
|
28
|
+
extra = pydantic_v1.Extra.allow
|
29
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -0,0 +1,33 @@
|
|
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
|
+
|
9
|
+
|
10
|
+
class SaveAssetRequestOut(pydantic_v1.BaseModel):
|
11
|
+
"""
|
12
|
+
Response model asset information representation.
|
13
|
+
"""
|
14
|
+
|
15
|
+
asset_id: str
|
16
|
+
|
17
|
+
def json(self, **kwargs: typing.Any) -> str:
|
18
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
19
|
+
return super().json(**kwargs_with_defaults)
|
20
|
+
|
21
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
22
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
23
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
24
|
+
|
25
|
+
return deep_union_pydantic_dicts(
|
26
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
27
|
+
)
|
28
|
+
|
29
|
+
class Config:
|
30
|
+
frozen = True
|
31
|
+
smart_union = True
|
32
|
+
extra = pydantic_v1.Extra.allow
|
33
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/core/datetime_utils.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/core/jsonable_encoder.py
RENAMED
File without changes
|
{athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/core/pydantic_utilities.py
RENAMED
File without changes
|
{athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/core/query_encoder.py
RENAMED
File without changes
|
{athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/core/remove_none_from_dict.py
RENAMED
File without changes
|
{athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/core/request_options.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/src/athena/query/types/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.102 → athena_intelligence-0.1.104}/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
|
File without changes
|
File without changes
|