malevich-coretools 0.3.50__tar.gz → 0.3.53__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.
Potentially problematic release.
This version of malevich-coretools might be problematic. Click here for more details.
- {malevich_coretools-0.3.50/malevich_coretools.egg-info → malevich_coretools-0.3.53}/PKG-INFO +1 -1
- malevich_coretools-0.3.53/VERSION +1 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/funcs/funcs.py +12 -5
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/funcs/helpers.py +111 -5
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/utils.py +5313 -263
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53/malevich_coretools.egg-info}/PKG-INFO +1 -1
- malevich_coretools-0.3.50/VERSION +0 -1
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/LICENSE +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/MANIFEST.in +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/README.md +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/__init__.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/abstract/__init__.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/abstract/abstract.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/abstract/operations.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/abstract/pipeline.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/abstract/statuses.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/admin/__init__.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/admin/utils.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/batch/__init__.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/batch/utils.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/funcs/__init__.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/funcs/checks.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/secondary/__init__.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/secondary/config.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/secondary/const.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/secondary/helpers.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/secondary/kafka_utils.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/tools/__init__.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/tools/abstract.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools/tools/vast.py +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools.egg-info/SOURCES.txt +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools.egg-info/dependency_links.txt +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools.egg-info/requires.txt +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/malevich_coretools.egg-info/top_level.txt +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/pyproject.toml +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/requirements.txt +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/setup.cfg +0 -0
- {malevich_coretools-0.3.50 → malevich_coretools-0.3.53}/setup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.3.53
|
|
@@ -7,6 +7,7 @@ from typing import Any, Callable, Optional
|
|
|
7
7
|
|
|
8
8
|
import aiohttp
|
|
9
9
|
import requests
|
|
10
|
+
from aiohttp.client_exceptions import ClientResponseError
|
|
10
11
|
from requests.models import Response
|
|
11
12
|
|
|
12
13
|
from malevich_coretools.abstract.abstract import * # noqa: F403
|
|
@@ -1630,29 +1631,35 @@ async def __get_result(id: str, is_text: bool = True, check_time: float = LONG_S
|
|
|
1630
1631
|
|
|
1631
1632
|
async def __async_check_response(response: aiohttp.ClientResponse, show_func: Optional[Callable]=None, path: Optional[str] = None): # noqa: ANN202
|
|
1632
1633
|
if not response.ok:
|
|
1634
|
+
text = await response.text()
|
|
1633
1635
|
if show_func is None:
|
|
1634
1636
|
if path is not None:
|
|
1635
|
-
text = await response.text()
|
|
1636
1637
|
msg = f"failed: {text}" if len(text) > 0 else "failed"
|
|
1637
1638
|
Config.logger.error(f"{path} {msg}")
|
|
1638
1639
|
else:
|
|
1639
|
-
Config.logger.error(
|
|
1640
|
+
Config.logger.error(text)
|
|
1640
1641
|
else:
|
|
1641
1642
|
if path is not None:
|
|
1642
1643
|
Config.logger.error(f"{path} failed")
|
|
1643
|
-
show_func(
|
|
1644
|
+
show_func(text, err=True)
|
|
1645
|
+
|
|
1646
|
+
if response.reason is not None and len(response.reason) == 0:
|
|
1647
|
+
response.reason = text
|
|
1644
1648
|
response.raise_for_status()
|
|
1645
1649
|
|
|
1646
1650
|
|
|
1647
1651
|
def __check_response(path: str, response: Response, show_func: Optional[Callable]=None): # noqa: ANN202
|
|
1648
1652
|
if response.status_code >= 400:
|
|
1653
|
+
text = response.text
|
|
1649
1654
|
if show_func is None:
|
|
1650
|
-
text = response.text
|
|
1651
1655
|
msg = f"failed: {text}" if len(text) > 0 else "failed"
|
|
1652
1656
|
Config.logger.error(f"{path} {msg}")
|
|
1653
1657
|
else:
|
|
1654
1658
|
Config.logger.error(f"{path} failed")
|
|
1655
|
-
show_func(
|
|
1659
|
+
show_func(text, err=True)
|
|
1660
|
+
|
|
1661
|
+
if response.reason is not None and len(response.reason) == 0:
|
|
1662
|
+
response.reason = text
|
|
1656
1663
|
response.raise_for_status()
|
|
1657
1664
|
|
|
1658
1665
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
-
from typing import Any, Dict, List, Optional, Union
|
|
2
|
+
from typing import Any, Coroutine, Dict, List, Literal, Optional, Union, overload
|
|
3
3
|
from uuid import uuid4
|
|
4
4
|
|
|
5
5
|
import pandas as pd
|
|
@@ -32,37 +32,89 @@ from malevich_coretools.secondary import Config, to_json
|
|
|
32
32
|
__all__ = ["create_collection_from_file_df", "update_collection_from_file_df", "raw_collection_from_df", "raw_collection_from_file", "create_collection_from_df", "update_collection_from_df", "create_app_settings", "create_user_config", "create_task_component", "create_task_policy", "create_restrictions", "create_run_settings", "create_endpoint_override", "create_cfg_struct"]
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
@overload
|
|
35
36
|
def create_collection_from_file_df(
|
|
36
37
|
file: str,
|
|
37
38
|
name: Optional[str],
|
|
38
39
|
metadata: Optional[Union[Dict[str, Any], str]],
|
|
39
40
|
*args,
|
|
41
|
+
is_async: Literal[False] = False,
|
|
40
42
|
**kwargs
|
|
41
43
|
) -> Alias.Id:
|
|
44
|
+
pass
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@overload
|
|
48
|
+
def create_collection_from_file_df(
|
|
49
|
+
file: str,
|
|
50
|
+
name: Optional[str],
|
|
51
|
+
metadata: Optional[Union[Dict[str, Any], str]],
|
|
52
|
+
*args,
|
|
53
|
+
is_async: Literal[True],
|
|
54
|
+
**kwargs
|
|
55
|
+
) -> Coroutine[Any, Any, Alias.Id]:
|
|
56
|
+
pass
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def create_collection_from_file_df(
|
|
60
|
+
file: str,
|
|
61
|
+
name: Optional[str],
|
|
62
|
+
metadata: Optional[Union[Dict[str, Any], str]],
|
|
63
|
+
*args,
|
|
64
|
+
is_async: bool = False,
|
|
65
|
+
**kwargs
|
|
66
|
+
) -> Union[Alias.Id, Coroutine[Any, Any, Alias.Id]]:
|
|
42
67
|
try:
|
|
43
68
|
data = pd.read_csv(file)
|
|
44
69
|
except pd.errors.EmptyDataError:
|
|
45
70
|
data = pd.DataFrame()
|
|
46
71
|
if name is None:
|
|
47
72
|
name = file
|
|
48
|
-
return create_collection_from_df(data, name=file, metadata=metadata, *args, **kwargs)
|
|
73
|
+
return create_collection_from_df(data, name=file, metadata=metadata, *args, is_async=is_async, **kwargs)
|
|
49
74
|
|
|
50
75
|
|
|
76
|
+
@overload
|
|
51
77
|
def update_collection_from_file_df(
|
|
52
78
|
id: str,
|
|
53
79
|
file: str,
|
|
54
80
|
name: Optional[str],
|
|
55
81
|
metadata: Optional[Union[Dict[str, Any], str]],
|
|
56
82
|
*args,
|
|
83
|
+
is_async: Literal[False] = False,
|
|
57
84
|
**kwargs
|
|
58
85
|
) -> Alias.Id:
|
|
86
|
+
pass
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
@overload
|
|
90
|
+
def update_collection_from_file_df(
|
|
91
|
+
id: str,
|
|
92
|
+
file: str,
|
|
93
|
+
name: Optional[str],
|
|
94
|
+
metadata: Optional[Union[Dict[str, Any], str]],
|
|
95
|
+
*args,
|
|
96
|
+
is_async: Literal[True],
|
|
97
|
+
**kwargs
|
|
98
|
+
) -> Coroutine[Any, Any, Alias.Id]:
|
|
99
|
+
pass
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def update_collection_from_file_df(
|
|
103
|
+
id: str,
|
|
104
|
+
file: str,
|
|
105
|
+
name: Optional[str],
|
|
106
|
+
metadata: Optional[Union[Dict[str, Any], str]],
|
|
107
|
+
*args,
|
|
108
|
+
is_async: bool = False,
|
|
109
|
+
**kwargs
|
|
110
|
+
) -> Union[Alias.Id, Coroutine[Any, Any, Alias.Id]]:
|
|
59
111
|
try:
|
|
60
112
|
data = pd.read_csv(file)
|
|
61
113
|
except pd.errors.EmptyDataError:
|
|
62
114
|
data = pd.DataFrame()
|
|
63
115
|
if name is None:
|
|
64
116
|
name = file
|
|
65
|
-
return update_collection_from_df(id, data, name=file, metadata=metadata, *args, **kwargs)
|
|
117
|
+
return update_collection_from_df(id, data, name=file, metadata=metadata, *args, is_async=is_async, **kwargs)
|
|
66
118
|
|
|
67
119
|
|
|
68
120
|
def raw_collection_from_df(
|
|
@@ -95,15 +147,41 @@ def raw_collection_from_file(
|
|
|
95
147
|
return raw_collection_from_df(data, name, metadata)
|
|
96
148
|
|
|
97
149
|
|
|
150
|
+
@overload
|
|
98
151
|
def create_collection_from_df(
|
|
99
152
|
data: pd.DataFrame,
|
|
100
153
|
name: Optional[str],
|
|
101
154
|
metadata: Optional[Union[Dict[str, Any], str]],
|
|
102
155
|
batcher: Optional[Batcher] = None,
|
|
103
|
-
is_async: bool = False,
|
|
104
156
|
*args,
|
|
157
|
+
is_async: Literal[False] = False,
|
|
105
158
|
**kwargs
|
|
106
159
|
) -> Alias.Id:
|
|
160
|
+
pass
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
@overload
|
|
164
|
+
def create_collection_from_df(
|
|
165
|
+
data: pd.DataFrame,
|
|
166
|
+
name: Optional[str],
|
|
167
|
+
metadata: Optional[Union[Dict[str, Any], str]],
|
|
168
|
+
batcher: Optional[Batcher] = None,
|
|
169
|
+
*args,
|
|
170
|
+
is_async: Literal[True],
|
|
171
|
+
**kwargs
|
|
172
|
+
) -> Coroutine[Any, Any, Alias.Id]:
|
|
173
|
+
pass
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def create_collection_from_df(
|
|
177
|
+
data: pd.DataFrame,
|
|
178
|
+
name: Optional[str],
|
|
179
|
+
metadata: Optional[Union[Dict[str, Any], str]],
|
|
180
|
+
batcher: Optional[Batcher] = None,
|
|
181
|
+
*args,
|
|
182
|
+
is_async: bool = False,
|
|
183
|
+
**kwargs
|
|
184
|
+
) -> Union[Alias.Id, Coroutine[Any, Any, Alias.Id]]:
|
|
107
185
|
if batcher is None:
|
|
108
186
|
batcher = Config.BATCHER
|
|
109
187
|
data = raw_collection_from_df(data, name, metadata)
|
|
@@ -114,16 +192,44 @@ def create_collection_from_df(
|
|
|
114
192
|
return post_collections_data(data, *args, **kwargs)
|
|
115
193
|
|
|
116
194
|
|
|
195
|
+
@overload
|
|
117
196
|
def update_collection_from_df(
|
|
118
197
|
id: str,
|
|
119
198
|
data: pd.DataFrame,
|
|
120
199
|
name: Optional[str],
|
|
121
200
|
metadata: Optional[Union[Dict[str, Any], str]],
|
|
122
201
|
batcher: Optional[Batcher] = None,
|
|
123
|
-
is_async: bool = False,
|
|
124
202
|
*args,
|
|
203
|
+
is_async: Literal[False] = False,
|
|
125
204
|
**kwargs
|
|
126
205
|
) -> Alias.Id:
|
|
206
|
+
pass
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
@overload
|
|
210
|
+
def update_collection_from_df(
|
|
211
|
+
id: str,
|
|
212
|
+
data: pd.DataFrame,
|
|
213
|
+
name: Optional[str],
|
|
214
|
+
metadata: Optional[Union[Dict[str, Any], str]],
|
|
215
|
+
batcher: Optional[Batcher] = None,
|
|
216
|
+
*args,
|
|
217
|
+
is_async: Literal[True],
|
|
218
|
+
**kwargs
|
|
219
|
+
) -> Coroutine[Any, Any, Alias.Id]:
|
|
220
|
+
pass
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def update_collection_from_df(
|
|
224
|
+
id: str,
|
|
225
|
+
data: pd.DataFrame,
|
|
226
|
+
name: Optional[str],
|
|
227
|
+
metadata: Optional[Union[Dict[str, Any], str]],
|
|
228
|
+
batcher: Optional[Batcher] = None,
|
|
229
|
+
*args,
|
|
230
|
+
is_async: bool = False,
|
|
231
|
+
**kwargs
|
|
232
|
+
) -> Union[Alias.Id, Coroutine[Any, Any, Alias.Id]]:
|
|
127
233
|
if batcher is None:
|
|
128
234
|
batcher = Config.BATCHER
|
|
129
235
|
data = raw_collection_from_df(data, name, metadata)
|