analytic-workspace-client 1.29.0rc1__tar.gz → 1.29.1__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.
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/PKG-INFO +2 -2
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/README.md +1 -1
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/setup.py +2 -2
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/analytic_workspace_client.egg-info/PKG-INFO +2 -2
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/analytic_workspace_client.egg-info/SOURCES.txt +2 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/analytic_workspace_client.egg-info/requires.txt +1 -1
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/etl_blocks/runtime.py +2 -2
- analytic_workspace_client-1.29.1/src/aw_client/ml/mlflow_wrapper.py +50 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/session.py +6 -20
- analytic_workspace_client-1.29.1/src/aw_etl/__init__.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/pyproject.toml +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/setup.cfg +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/analytic_workspace_client.egg-info/dependency_links.txt +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/analytic_workspace_client.egg-info/top_level.txt +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/__init__.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/cache.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/core/__init__.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/core/bundle.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/core/compiler.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/core/model_vault.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/core/spark.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/data_master/__init__.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/data_master/base.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/data_master/v0.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/data_master/v1.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/data_master/v2.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/domain.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/etl_blocks/__init__.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/etl_blocks/application.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/etl_blocks/dto.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/etl_blocks/services.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/etl_blocks/test_data.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/etl_blocks/tools.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/exceptions.py +0 -0
- {analytic_workspace_client-1.29.0rc1/src/aw_client/model_dev → analytic_workspace_client-1.29.1/src/aw_client/ml}/__init__.py +0 -0
- {analytic_workspace_client-1.29.0rc1/src/aw_client/models → analytic_workspace_client-1.29.1/src/aw_client/model_dev}/__init__.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/model_dev/application.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/model_dev/cache.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/model_dev/runner.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/model_dev/virtual_objects.py +0 -0
- {analytic_workspace_client-1.29.0rc1/src/aw_etl → analytic_workspace_client-1.29.1/src/aw_client/models}/__init__.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/models/model_schema.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/tools.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_etl/compiler.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_etl/etl_blocks.py +0 -0
- {analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_etl/models.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: analytic_workspace_client
|
|
3
|
-
Version: 1.29.
|
|
3
|
+
Version: 1.29.1
|
|
4
4
|
Summary: Библиотека для подключения к Analytic Workspace
|
|
5
5
|
Home-page: https://analyticworkspace.ru/
|
|
6
6
|
Author: Analytic Workspace
|
|
@@ -35,7 +35,7 @@ session = Session(token=aw_token, aw_url='https://aw.example.ru')
|
|
|
35
35
|
# Если токен доступа указан в переменной окружения AW_DATA_TOKEN, то объект сессии можно создавать
|
|
36
36
|
# без явного указания параметра token: session = Session(aw_url='https://aw.example.ru')
|
|
37
37
|
|
|
38
|
-
df = session.load() # df: pandas.DataFrame
|
|
38
|
+
df = session.load(model_id=123) # df: pandas.DataFrame
|
|
39
39
|
|
|
40
40
|
display(df)
|
|
41
41
|
```
|
|
@@ -20,7 +20,7 @@ session = Session(token=aw_token, aw_url='https://aw.example.ru')
|
|
|
20
20
|
# Если токен доступа указан в переменной окружения AW_DATA_TOKEN, то объект сессии можно создавать
|
|
21
21
|
# без явного указания параметра token: session = Session(aw_url='https://aw.example.ru')
|
|
22
22
|
|
|
23
|
-
df = session.load() # df: pandas.DataFrame
|
|
23
|
+
df = session.load(model_id=123) # df: pandas.DataFrame
|
|
24
24
|
|
|
25
25
|
display(df)
|
|
26
26
|
```
|
|
@@ -10,7 +10,7 @@ long_description = (here / "README.md").read_text(encoding="utf-8")
|
|
|
10
10
|
|
|
11
11
|
setup(
|
|
12
12
|
name='analytic_workspace_client',
|
|
13
|
-
version='1.29.
|
|
13
|
+
version='1.29.1',
|
|
14
14
|
|
|
15
15
|
description='Библиотека для подключения к Analytic Workspace',
|
|
16
16
|
long_description=long_description,
|
|
@@ -42,7 +42,7 @@ setup(
|
|
|
42
42
|
|
|
43
43
|
extras_require={
|
|
44
44
|
'dev': ['pyspark==3.5.0', 'pytest>=8.2,<8.3'],
|
|
45
|
-
'ml': ['mlflow
|
|
45
|
+
'ml': ['mlflow==2.14.3']
|
|
46
46
|
},
|
|
47
47
|
|
|
48
48
|
setup_requires=['wheel'],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: analytic-workspace-client
|
|
3
|
-
Version: 1.29.
|
|
3
|
+
Version: 1.29.1
|
|
4
4
|
Summary: Библиотека для подключения к Analytic Workspace
|
|
5
5
|
Home-page: https://analyticworkspace.ru/
|
|
6
6
|
Author: Analytic Workspace
|
|
@@ -35,7 +35,7 @@ session = Session(token=aw_token, aw_url='https://aw.example.ru')
|
|
|
35
35
|
# Если токен доступа указан в переменной окружения AW_DATA_TOKEN, то объект сессии можно создавать
|
|
36
36
|
# без явного указания параметра token: session = Session(aw_url='https://aw.example.ru')
|
|
37
37
|
|
|
38
|
-
df = session.load() # df: pandas.DataFrame
|
|
38
|
+
df = session.load(model_id=123) # df: pandas.DataFrame
|
|
39
39
|
|
|
40
40
|
display(df)
|
|
41
41
|
```
|
|
@@ -29,6 +29,8 @@ src/aw_client/etl_blocks/runtime.py
|
|
|
29
29
|
src/aw_client/etl_blocks/services.py
|
|
30
30
|
src/aw_client/etl_blocks/test_data.py
|
|
31
31
|
src/aw_client/etl_blocks/tools.py
|
|
32
|
+
src/aw_client/ml/__init__.py
|
|
33
|
+
src/aw_client/ml/mlflow_wrapper.py
|
|
32
34
|
src/aw_client/model_dev/__init__.py
|
|
33
35
|
src/aw_client/model_dev/application.py
|
|
34
36
|
src/aw_client/model_dev/cache.py
|
|
@@ -105,7 +105,7 @@ def get_etl_block_schema(block_path: Path,
|
|
|
105
105
|
if 'app' in block_schema_parameters:
|
|
106
106
|
block_schema_kwargs['app'] = app
|
|
107
107
|
if 'model_object' in block_schema_parameters:
|
|
108
|
-
block_schema_kwargs['model_object'] = build_model_object(test_data)
|
|
108
|
+
block_schema_kwargs['model_object'] = build_model_object(test_data[0] if isinstance(test_data, list) else test_data)
|
|
109
109
|
if 'schema' in block_schema_parameters:
|
|
110
110
|
block_schema_kwargs['schema'] = upstream_schemas.first()
|
|
111
111
|
if 'schemas' in block_schema_parameters:
|
|
@@ -188,7 +188,7 @@ def get_etl_block_data(block_path: Path,
|
|
|
188
188
|
if 'app' in block_data_parameters:
|
|
189
189
|
block_schema_kwargs['app'] = app
|
|
190
190
|
if 'model_object' in block_data_parameters:
|
|
191
|
-
block_schema_kwargs['model_object'] = build_model_object(test_data)
|
|
191
|
+
block_schema_kwargs['model_object'] = build_model_object(test_data[0] if isinstance(test_data, list) else test_data)
|
|
192
192
|
if 'df' in block_data_parameters:
|
|
193
193
|
block_schema_kwargs['df'] = upstream_dataframes.first()
|
|
194
194
|
if 'dfs' in block_data_parameters:
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from urllib.parse import urljoin
|
|
3
|
+
|
|
4
|
+
from aw_client.exceptions import AwClientMisconfigured
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class MlflowWrapper:
|
|
8
|
+
""" """
|
|
9
|
+
def __init__(self, aw_url: str, auth_token: str):
|
|
10
|
+
""" """
|
|
11
|
+
self.aw_url = aw_url
|
|
12
|
+
self.auth_token = auth_token
|
|
13
|
+
self.mlflow = None
|
|
14
|
+
|
|
15
|
+
def _mlflow(self):
|
|
16
|
+
""" """
|
|
17
|
+
if not self.mlflow:
|
|
18
|
+
try:
|
|
19
|
+
import mlflow
|
|
20
|
+
except ImportError:
|
|
21
|
+
raise AwClientMisconfigured(
|
|
22
|
+
'Для использованиея MLFlow установите библиотеку с опцией ml: pip install analytic-workspace-client[ml]')
|
|
23
|
+
|
|
24
|
+
if not self.auth_token:
|
|
25
|
+
data_master_url = urljoin(self.aw_url, 'data-master/get-token')
|
|
26
|
+
raise AwClientMisconfigured(
|
|
27
|
+
f'Не указан токен доступа к AnalyticWorkspace. Пройдите по адресу {data_master_url} для получения '
|
|
28
|
+
f'токена.')
|
|
29
|
+
|
|
30
|
+
tracking_url = urljoin(self.aw_url, 'mlflow')
|
|
31
|
+
|
|
32
|
+
if mlflow.get_tracking_uri() != tracking_url:
|
|
33
|
+
mlflow.set_tracking_uri(tracking_url)
|
|
34
|
+
|
|
35
|
+
os.environ['MLFLOW_TRACKING_TOKEN'] = self.auth_token
|
|
36
|
+
self.mlflow = mlflow
|
|
37
|
+
|
|
38
|
+
return self.mlflow
|
|
39
|
+
|
|
40
|
+
def setup_experiment(self, experiment_name: str) -> str:
|
|
41
|
+
""" """
|
|
42
|
+
mlflow = self._mlflow()
|
|
43
|
+
|
|
44
|
+
experiment = mlflow.get_experiment_by_name(experiment_name)
|
|
45
|
+
return mlflow.create_experiment(experiment_name) if experiment is None else experiment.experiment_id
|
|
46
|
+
|
|
47
|
+
def __getattr__(self, name: str):
|
|
48
|
+
""" """
|
|
49
|
+
mlflow = self._mlflow()
|
|
50
|
+
return getattr(mlflow, name)
|
{analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/session.py
RENAMED
|
@@ -12,6 +12,7 @@ from aw_client.data_master import get_nearest_api
|
|
|
12
12
|
from aw_client.domain import APIConfig
|
|
13
13
|
from aw_client.models.model_schema import ModelSchema
|
|
14
14
|
from aw_client.exceptions import AwClientMisconfigured
|
|
15
|
+
from aw_client.ml.mlflow_wrapper import MlflowWrapper
|
|
15
16
|
|
|
16
17
|
from aw_client.tools import strip_column_name_prefix
|
|
17
18
|
|
|
@@ -34,6 +35,7 @@ class Session:
|
|
|
34
35
|
if not self.aw_url.endswith('/'):
|
|
35
36
|
self.aw_url += '/'
|
|
36
37
|
self.version = version if version is not None else None
|
|
38
|
+
self._mlflow_wrapper = None
|
|
37
39
|
|
|
38
40
|
def get_aw_version(self) -> int:
|
|
39
41
|
""" """
|
|
@@ -132,23 +134,7 @@ class Session:
|
|
|
132
134
|
@property
|
|
133
135
|
def mlflow(self):
|
|
134
136
|
""" """
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
'Для использованиея MLFlow установите библиотеку с опцией ml: pip install analytic-workspace-client[ml]')
|
|
140
|
-
|
|
141
|
-
if not self.token:
|
|
142
|
-
data_master_url = urljoin(self.aw_url, 'data-master/get-token')
|
|
143
|
-
raise AwClientMisconfigured(
|
|
144
|
-
f'Не указан токен доступа к AnalyticWorkspace. Пройдите по адресу {data_master_url} для получения '
|
|
145
|
-
f'токена')
|
|
146
|
-
|
|
147
|
-
tracking_url = urljoin(self.aw_url, 'mlflow')
|
|
148
|
-
|
|
149
|
-
if mlflow.get_tracking_uri() != tracking_url:
|
|
150
|
-
mlflow.set_tracking_uri(tracking_url)
|
|
151
|
-
|
|
152
|
-
os.environ['MLFLOW_TRACKING_TOKEN'] = self.token
|
|
153
|
-
|
|
154
|
-
return mlflow
|
|
137
|
+
if self._mlflow_wrapper is None:
|
|
138
|
+
self._mlflow_wrapper = MlflowWrapper(aw_url=self.aw_url, auth_token=self.token)
|
|
139
|
+
|
|
140
|
+
return self._mlflow_wrapper
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/__init__.py
RENAMED
|
File without changes
|
{analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/cache.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/core/spark.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/domain.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/exceptions.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
|
|
File without changes
|
{analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_client/tools.py
RENAMED
|
File without changes
|
{analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_etl/compiler.py
RENAMED
|
File without changes
|
{analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_etl/etl_blocks.py
RENAMED
|
File without changes
|
{analytic_workspace_client-1.29.0rc1 → analytic_workspace_client-1.29.1}/src/aw_etl/models.py
RENAMED
|
File without changes
|