superb-ai-onprem 0.3.1__tar.gz → 0.3.2__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 superb-ai-onprem might be problematic. Click here for more details.
- {superb_ai_onprem-0.3.1/superb_ai_onprem.egg-info → superb_ai_onprem-0.3.2}/PKG-INFO +1 -1
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/_version.py +2 -2
- superb_ai_onprem-0.3.2/spb_onprem/activities/__init__.py +8 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/entities/activity_history.py +2 -2
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/params/__init__.py +2 -0
- superb_ai_onprem-0.3.2/spb_onprem/activities/params/get_activity_history.py +20 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/params/update_activity.py +6 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/queries.py +16 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/service.py +38 -9
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2/superb_ai_onprem.egg-info}/PKG-INFO +1 -1
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/superb_ai_onprem.egg-info/SOURCES.txt +2 -0
- superb_ai_onprem-0.3.2/tests/activities/test_get_activity_history.py +138 -0
- superb_ai_onprem-0.3.1/spb_onprem/users/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/.github/workflows/publish.yml +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/.gitignore +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/LICENSE +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/Pipfile +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/Pipfile.lock +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/README.md +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/pyproject.toml +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/setup.cfg +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/setup.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/entities/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/entities/activity.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/params/activities.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/params/activity.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/params/create_activity.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/params/delete_activity.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/params/start_activity.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/params/update_activity_history.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/base_model.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/base_service.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/base_types.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/contents/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/contents/entities/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/contents/entities/base_content.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/contents/entities/content.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/contents/queries.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/contents/service.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/entities/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/entities/annotation.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/entities/data.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/entities/data_meta.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/entities/prediction.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/entities/scene.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/enums/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/enums/data_meta_type.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/enums/data_type.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/enums/scene_type.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/create_data.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/data.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/data_list.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/delete_annotation_version.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/delete_data.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/delete_prediction.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/delete_scene.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/insert_annotation_version.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/insert_data_to_slice.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/insert_prediction.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/insert_scene.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/remove_data_from_slice.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/remove_data_meta.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/update_annotation.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/update_data.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/update_scene.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/upsert_data_meta.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/queries.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/service.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/datasets/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/datasets/entities/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/datasets/entities/dataset.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/datasets/params/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/datasets/params/create_dataset.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/datasets/params/dataset.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/datasets/params/datasets.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/datasets/params/update_dataset.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/datasets/queries.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/datasets/service.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/entities.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/exceptions.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/exports/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/exports/entities/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/exports/entities/export.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/exports/params/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/exports/params/create_export.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/exports/params/delete_export.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/exports/params/export.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/exports/params/exports.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/exports/params/update_export.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/exports/queries/get_exports.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/exports/queries.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/exports/service.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/searches.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/slices/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/slices/entities/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/slices/entities/slice.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/slices/params/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/slices/params/create_slice.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/slices/params/delete_slice.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/slices/params/slice.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/slices/params/slices.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/slices/params/update_slice.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/slices/queries.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/slices/service.py +0 -0
- {superb_ai_onprem-0.3.1/spb_onprem/activities → superb_ai_onprem-0.3.2/spb_onprem/users}/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/users/entities/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/users/entities/auth.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/superb_ai_onprem.egg-info/dependency_links.txt +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/superb_ai_onprem.egg-info/requires.txt +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/superb_ai_onprem.egg-info/top_level.txt +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/tests/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/tests/activities/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/tests/activities/real_test.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/tests/activities/test_params.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/tests/activities/test_service.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/tests/exports/__init__.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/tests/exports/real_test.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/tests/exports/test_entities.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/tests/exports/test_integration.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/tests/exports/test_params.py +0 -0
- {superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/tests/exports/test_service.py +0 -0
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/entities/activity_history.py
RENAMED
|
@@ -20,8 +20,8 @@ class ActivityHistory(CustomBaseModel):
|
|
|
20
20
|
activity_id: Optional[str] = Field(None, alias="jobId")
|
|
21
21
|
status: Optional[ActivityStatus] = Field(None, alias="status")
|
|
22
22
|
|
|
23
|
-
parameters: Optional[
|
|
24
|
-
progress: Optional[
|
|
23
|
+
parameters: Optional[dict] = Field(None, alias="parameters")
|
|
24
|
+
progress: Optional[dict] = Field(None, alias="progress")
|
|
25
25
|
|
|
26
26
|
meta: Optional[dict] = Field(None, alias="meta")
|
|
27
27
|
|
|
@@ -9,6 +9,7 @@ from .update_activity import update_activity_params
|
|
|
9
9
|
from .delete_activity import delete_activity_params
|
|
10
10
|
from .start_activity import start_activity_params
|
|
11
11
|
from .update_activity_history import update_activity_history_params
|
|
12
|
+
from .get_activity_history import get_activity_history_params
|
|
12
13
|
|
|
13
14
|
__all__ = (
|
|
14
15
|
"ActivitiesFilter",
|
|
@@ -20,4 +21,5 @@ __all__ = (
|
|
|
20
21
|
"delete_activity_params",
|
|
21
22
|
"start_activity_params",
|
|
22
23
|
"update_activity_history_params",
|
|
24
|
+
"get_activity_history_params",
|
|
23
25
|
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from typing import Dict, Any
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def get_activity_history_params(
|
|
5
|
+
dataset_id: str,
|
|
6
|
+
activity_history_id: str,
|
|
7
|
+
) -> Dict[str, Any]:
|
|
8
|
+
"""Get parameters for getting activity history.
|
|
9
|
+
|
|
10
|
+
Args:
|
|
11
|
+
dataset_id (str): The ID of the dataset
|
|
12
|
+
activity_history_id (str): The ID of the job
|
|
13
|
+
|
|
14
|
+
Returns:
|
|
15
|
+
Dict[str, Any]: The parameters for the query
|
|
16
|
+
"""
|
|
17
|
+
return {
|
|
18
|
+
"dataset_id": dataset_id,
|
|
19
|
+
"job_history_id": activity_history_id,
|
|
20
|
+
}
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/params/update_activity.py
RENAMED
|
@@ -6,6 +6,10 @@ from spb_onprem.activities.entities import ActivitySchema
|
|
|
6
6
|
|
|
7
7
|
def update_activity_params(
|
|
8
8
|
activity_id: str,
|
|
9
|
+
dataset_id: Union[
|
|
10
|
+
str,
|
|
11
|
+
UndefinedType
|
|
12
|
+
] = Undefined,
|
|
9
13
|
activity_type: Union[
|
|
10
14
|
str,
|
|
11
15
|
UndefinedType
|
|
@@ -61,6 +65,8 @@ def update_activity_params(
|
|
|
61
65
|
"id": activity_id
|
|
62
66
|
}
|
|
63
67
|
|
|
68
|
+
if dataset_id is not Undefined:
|
|
69
|
+
params["datasetId"] = dataset_id
|
|
64
70
|
if activity_type is not Undefined:
|
|
65
71
|
params["type"] = activity_type
|
|
66
72
|
if name is not Undefined:
|
|
@@ -8,6 +8,7 @@ from spb_onprem.activities.params import (
|
|
|
8
8
|
|
|
9
9
|
start_activity_params,
|
|
10
10
|
update_activity_history_params,
|
|
11
|
+
get_activity_history_params,
|
|
11
12
|
)
|
|
12
13
|
|
|
13
14
|
class Schemas:
|
|
@@ -103,6 +104,21 @@ class Queries:
|
|
|
103
104
|
"variables": get_activity_params,
|
|
104
105
|
}
|
|
105
106
|
|
|
107
|
+
GET_ACTIVITY_HISTORY = {
|
|
108
|
+
"name": "jobHistory",
|
|
109
|
+
"query": f'''
|
|
110
|
+
query jobHistory(
|
|
111
|
+
$dataset_id: ID,
|
|
112
|
+
$job_history_id: ID!
|
|
113
|
+
) {{
|
|
114
|
+
jobHistory(datasetId: $dataset_id, id: $job_history_id) {{
|
|
115
|
+
{Schemas.ACTIVITY_HISTORY}
|
|
116
|
+
}}
|
|
117
|
+
}}
|
|
118
|
+
''',
|
|
119
|
+
"variables": get_activity_history_params,
|
|
120
|
+
}
|
|
121
|
+
|
|
106
122
|
CREATE_ACTIVITY = {
|
|
107
123
|
"name": "createJob",
|
|
108
124
|
"query": f'''
|
|
@@ -127,6 +127,29 @@ class ActivityService(BaseService):
|
|
|
127
127
|
)
|
|
128
128
|
return Activity.model_validate(response)
|
|
129
129
|
|
|
130
|
+
def get_activity_history(
|
|
131
|
+
self,
|
|
132
|
+
dataset_id: str,
|
|
133
|
+
activity_history_id: str,
|
|
134
|
+
) -> ActivityHistory:
|
|
135
|
+
"""Get an activity history.
|
|
136
|
+
|
|
137
|
+
Args:
|
|
138
|
+
dataset_id (str): The ID of the dataset to get the activity history for.
|
|
139
|
+
activity_history_id (str): The ID of the job to get the activity history for.
|
|
140
|
+
|
|
141
|
+
Returns:
|
|
142
|
+
ActivityHistory: The activity history object.
|
|
143
|
+
"""
|
|
144
|
+
response = self.request_gql(
|
|
145
|
+
Queries.GET_ACTIVITY_HISTORY,
|
|
146
|
+
Queries.GET_ACTIVITY_HISTORY["variables"](
|
|
147
|
+
dataset_id=dataset_id,
|
|
148
|
+
activity_history_id=activity_history_id,
|
|
149
|
+
)
|
|
150
|
+
)
|
|
151
|
+
return ActivityHistory.model_validate(response)
|
|
152
|
+
|
|
130
153
|
def update_activity(
|
|
131
154
|
self,
|
|
132
155
|
activity_id: str,
|
|
@@ -236,12 +259,12 @@ class ActivityService(BaseService):
|
|
|
236
259
|
"""Start an activity.
|
|
237
260
|
|
|
238
261
|
Args:
|
|
262
|
+
dataset_id (str): The ID of the dataset to start the activity for.
|
|
239
263
|
activity_id (Optional[str]): The ID of the activity to start.
|
|
240
|
-
dataset_id (Optional[str]): The ID of the dataset to start the activity for.
|
|
241
264
|
activity_type (Optional[str]): The type of the activity to start.
|
|
242
|
-
parameters (Optional[dict]): The parameters
|
|
243
|
-
progress (Optional[dict]): The progress
|
|
244
|
-
meta (Optional[dict]): The meta
|
|
265
|
+
parameters (Optional[dict]): The parameters for the activity.
|
|
266
|
+
progress (Optional[dict]): The progress for the activity.
|
|
267
|
+
meta (Optional[dict]): The meta for the activity.
|
|
245
268
|
|
|
246
269
|
Returns:
|
|
247
270
|
ActivityHistory: The activity history object.
|
|
@@ -258,7 +281,7 @@ class ActivityService(BaseService):
|
|
|
258
281
|
)
|
|
259
282
|
)
|
|
260
283
|
return ActivityHistory.model_validate(response)
|
|
261
|
-
|
|
284
|
+
|
|
262
285
|
def update_activity_history_status(
|
|
263
286
|
self,
|
|
264
287
|
activity_history_id: str,
|
|
@@ -272,8 +295,11 @@ class ActivityService(BaseService):
|
|
|
272
295
|
|
|
273
296
|
Args:
|
|
274
297
|
activity_history_id (str): The ID of the activity history to update.
|
|
275
|
-
status (ActivityStatus): The status
|
|
276
|
-
meta (Optional[dict]): The meta
|
|
298
|
+
status (ActivityStatus): The new status for the activity history.
|
|
299
|
+
meta (Optional[dict]): The meta for the activity history.
|
|
300
|
+
|
|
301
|
+
Returns:
|
|
302
|
+
ActivityHistory: The updated activity history object.
|
|
277
303
|
"""
|
|
278
304
|
response = self.request_gql(
|
|
279
305
|
Queries.UPDATE_ACTIVITY_HISTORY,
|
|
@@ -301,8 +327,11 @@ class ActivityService(BaseService):
|
|
|
301
327
|
|
|
302
328
|
Args:
|
|
303
329
|
activity_history_id (str): The ID of the activity history to update.
|
|
304
|
-
progress (Optional[dict]): The progress
|
|
305
|
-
meta (Optional[dict]): The meta
|
|
330
|
+
progress (Optional[dict]): The new progress for the activity history.
|
|
331
|
+
meta (Optional[dict]): The meta for the activity history.
|
|
332
|
+
|
|
333
|
+
Returns:
|
|
334
|
+
ActivityHistory: The updated activity history object.
|
|
306
335
|
"""
|
|
307
336
|
response = self.request_gql(
|
|
308
337
|
Queries.UPDATE_ACTIVITY_HISTORY,
|
|
@@ -25,6 +25,7 @@ spb_onprem/activities/params/activities.py
|
|
|
25
25
|
spb_onprem/activities/params/activity.py
|
|
26
26
|
spb_onprem/activities/params/create_activity.py
|
|
27
27
|
spb_onprem/activities/params/delete_activity.py
|
|
28
|
+
spb_onprem/activities/params/get_activity_history.py
|
|
28
29
|
spb_onprem/activities/params/start_activity.py
|
|
29
30
|
spb_onprem/activities/params/update_activity.py
|
|
30
31
|
spb_onprem/activities/params/update_activity_history.py
|
|
@@ -109,6 +110,7 @@ superb_ai_onprem.egg-info/top_level.txt
|
|
|
109
110
|
tests/__init__.py
|
|
110
111
|
tests/activities/__init__.py
|
|
111
112
|
tests/activities/real_test.py
|
|
113
|
+
tests/activities/test_get_activity_history.py
|
|
112
114
|
tests/activities/test_params.py
|
|
113
115
|
tests/activities/test_service.py
|
|
114
116
|
tests/exports/__init__.py
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
from unittest.mock import MagicMock
|
|
3
|
+
|
|
4
|
+
from spb_onprem.activities.service import ActivityService
|
|
5
|
+
from spb_onprem.activities.entities import ActivityHistory, ActivityStatus
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@pytest.fixture
|
|
9
|
+
def activity_service():
|
|
10
|
+
return ActivityService()
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class TestGetActivityHistory:
|
|
14
|
+
def test_get_activity_history(self, activity_service):
|
|
15
|
+
# Given
|
|
16
|
+
mock_response = {
|
|
17
|
+
"id": "test_history_id",
|
|
18
|
+
"jobId": "test_job_id",
|
|
19
|
+
"status": "SUCCESS",
|
|
20
|
+
"datasetId": "test_dataset_id",
|
|
21
|
+
"parameters": {"param1": "value1"},
|
|
22
|
+
"progress": {"current": 50, "total": 100},
|
|
23
|
+
"createdAt": "2024-01-01T00:00:00Z",
|
|
24
|
+
"createdBy": "test_user",
|
|
25
|
+
"updatedAt": "2024-01-01T01:00:00Z",
|
|
26
|
+
"updatedBy": "test_user",
|
|
27
|
+
"meta": {"type": "export"}
|
|
28
|
+
}
|
|
29
|
+
activity_service.request_gql = MagicMock(return_value=mock_response)
|
|
30
|
+
|
|
31
|
+
# When
|
|
32
|
+
history = activity_service.get_activity_history(
|
|
33
|
+
dataset_id="test_dataset_id",
|
|
34
|
+
activity_history_id="test_history_id"
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
# Then
|
|
38
|
+
assert isinstance(history, ActivityHistory)
|
|
39
|
+
assert history.id == "test_history_id"
|
|
40
|
+
assert history.activity_id == "test_job_id"
|
|
41
|
+
assert history.status == ActivityStatus.SUCCESS
|
|
42
|
+
assert history.dataset_id == "test_dataset_id"
|
|
43
|
+
assert history.parameters == {"param1": "value1"}
|
|
44
|
+
assert history.progress == {"current": 50, "total": 100}
|
|
45
|
+
assert history.created_at == "2024-01-01T00:00:00Z"
|
|
46
|
+
assert history.created_by == "test_user"
|
|
47
|
+
assert history.updated_at == "2024-01-01T01:00:00Z"
|
|
48
|
+
assert history.updated_by == "test_user"
|
|
49
|
+
assert history.meta == {"type": "export"}
|
|
50
|
+
|
|
51
|
+
def test_get_activity_history_minimal_data(self, activity_service):
|
|
52
|
+
# Given
|
|
53
|
+
mock_response = {
|
|
54
|
+
"id": "test_history_id",
|
|
55
|
+
"jobId": "test_job_id",
|
|
56
|
+
"status": "PENDING",
|
|
57
|
+
"datasetId": "test_dataset_id"
|
|
58
|
+
}
|
|
59
|
+
activity_service.request_gql = MagicMock(return_value=mock_response)
|
|
60
|
+
|
|
61
|
+
# When
|
|
62
|
+
history = activity_service.get_activity_history(
|
|
63
|
+
dataset_id="test_dataset_id",
|
|
64
|
+
activity_history_id="test_history_id"
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
# Then
|
|
68
|
+
assert isinstance(history, ActivityHistory)
|
|
69
|
+
assert history.id == "test_history_id"
|
|
70
|
+
assert history.activity_id == "test_job_id"
|
|
71
|
+
assert history.status == ActivityStatus.PENDING
|
|
72
|
+
assert history.dataset_id == "test_dataset_id"
|
|
73
|
+
assert history.parameters is None
|
|
74
|
+
assert history.progress is None
|
|
75
|
+
assert history.meta is None
|
|
76
|
+
|
|
77
|
+
def test_activity_history_model_validation(self):
|
|
78
|
+
# Given
|
|
79
|
+
history_data = {
|
|
80
|
+
"id": "test_history_id",
|
|
81
|
+
"jobId": "test_job_id",
|
|
82
|
+
"status": "RUNNING",
|
|
83
|
+
"datasetId": "test_dataset_id",
|
|
84
|
+
"parameters": {"param1": "value1"},
|
|
85
|
+
"progress": {"current": 25, "total": 100},
|
|
86
|
+
"createdAt": "2024-01-01T00:00:00Z",
|
|
87
|
+
"createdBy": "test_user",
|
|
88
|
+
"updatedAt": "2024-01-01T01:00:00Z",
|
|
89
|
+
"updatedBy": "test_user",
|
|
90
|
+
"meta": {"type": "export", "version": "1.0"}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
# When
|
|
94
|
+
history = ActivityHistory.model_validate(history_data)
|
|
95
|
+
|
|
96
|
+
# Then
|
|
97
|
+
assert isinstance(history, ActivityHistory)
|
|
98
|
+
assert history.id == "test_history_id"
|
|
99
|
+
assert history.activity_id == "test_job_id"
|
|
100
|
+
assert history.status == ActivityStatus.RUNNING
|
|
101
|
+
assert history.dataset_id == "test_dataset_id"
|
|
102
|
+
assert history.parameters == {"param1": "value1"}
|
|
103
|
+
assert history.progress == {"current": 25, "total": 100}
|
|
104
|
+
assert history.created_at == "2024-01-01T00:00:00Z"
|
|
105
|
+
assert history.created_by == "test_user"
|
|
106
|
+
assert history.updated_at == "2024-01-01T01:00:00Z"
|
|
107
|
+
assert history.updated_by == "test_user"
|
|
108
|
+
assert history.meta == {"type": "export", "version": "1.0"}
|
|
109
|
+
|
|
110
|
+
def test_get_activity_history_with_different_statuses(self, activity_service):
|
|
111
|
+
# Test different status values
|
|
112
|
+
statuses = [
|
|
113
|
+
("PENDING", ActivityStatus.PENDING),
|
|
114
|
+
("RUNNING", ActivityStatus.RUNNING),
|
|
115
|
+
("SUCCESS", ActivityStatus.SUCCESS),
|
|
116
|
+
("FAILED", ActivityStatus.FAILED),
|
|
117
|
+
("CANCELLED", ActivityStatus.CANCELLED),
|
|
118
|
+
]
|
|
119
|
+
|
|
120
|
+
for status_value, expected_status in statuses:
|
|
121
|
+
# Given
|
|
122
|
+
mock_response = {
|
|
123
|
+
"id": f"history_{status_value.lower()}",
|
|
124
|
+
"jobId": "test_job_id",
|
|
125
|
+
"status": status_value,
|
|
126
|
+
"datasetId": "test_dataset_id"
|
|
127
|
+
}
|
|
128
|
+
activity_service.request_gql = MagicMock(return_value=mock_response)
|
|
129
|
+
|
|
130
|
+
# When
|
|
131
|
+
history = activity_service.get_activity_history(
|
|
132
|
+
dataset_id="test_dataset_id",
|
|
133
|
+
activity_history_id=f"history_{status_value.lower()}"
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
# Then
|
|
137
|
+
assert history.status == expected_status
|
|
138
|
+
assert history.id == f"history_{status_value.lower()}"
|
|
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
|
|
File without changes
|
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/entities/__init__.py
RENAMED
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/entities/activity.py
RENAMED
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/params/activities.py
RENAMED
|
File without changes
|
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/params/create_activity.py
RENAMED
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/params/delete_activity.py
RENAMED
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/activities/params/start_activity.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/contents/entities/base_content.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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/delete_prediction.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/insert_data_to_slice.py
RENAMED
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/insert_prediction.py
RENAMED
|
File without changes
|
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/remove_data_from_slice.py
RENAMED
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/remove_data_meta.py
RENAMED
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/update_annotation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/data/params/upsert_data_meta.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/datasets/params/create_dataset.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/datasets/params/update_dataset.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
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/exports/params/create_export.py
RENAMED
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/exports/params/delete_export.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/spb_onprem/exports/params/update_export.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{superb_ai_onprem-0.3.1/spb_onprem/activities → superb_ai_onprem-0.3.2/spb_onprem/users}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{superb_ai_onprem-0.3.1 → superb_ai_onprem-0.3.2}/superb_ai_onprem.egg-info/dependency_links.txt
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|