wizata-dsapi 2.1.0.dev10__tar.gz → 2.1.0.dev12__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.
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/PKG-INFO +1 -1
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/__init__.py +1 -1
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/trigger.py +62 -1
- wizata_dsapi-2.1.0.dev12/wizata_dsapi/version.py +1 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/wizata_dsapi_client.py +9 -4
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi.egg-info/PKG-INFO +1 -1
- wizata_dsapi-2.1.0.dev10/wizata_dsapi/version.py +0 -1
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/LICENSE.txt +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/README.rst +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/setup.cfg +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/setup.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/api_config.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/api_dto.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/api_interface.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/bucket.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/business_label.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/context.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/dashboard.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/dataframe_toolkit.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/datapoint.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/datastore.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/ds_dataframe.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/dsapi_json_encoder.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/edge_config.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/edge_device.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/edge_module.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/evaluation.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/execution.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/execution_log.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/experiment.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/graylog_log.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/group_system.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/ilogger.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/insight.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/mlmodel.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/mobile_asset.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/model_toolkit.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/models/__init__.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/models/common.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/notification.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/paged_query_result.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/pipeline.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/pipeline_image.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/plot.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/plots/__init__.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/plots/common.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/plots/theme.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/request.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/script.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/scripts/__init__.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/scripts/common.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/search.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/solution_component.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/streamlit_utils.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/template.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/template_config.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/twin.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/twinregistration.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/user.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/wizard_function.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/wizard_request.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi/words.py +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi.egg-info/SOURCES.txt +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi.egg-info/dependency_links.txt +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi.egg-info/requires.txt +0 -0
- {wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi.egg-info/top_level.txt +0 -0
|
@@ -14,7 +14,7 @@ from .template import Template, TemplateProperty
|
|
|
14
14
|
from .solution_component import SolutionComponent, SolutionType
|
|
15
15
|
from .business_label import BusinessLabel
|
|
16
16
|
from .twinregistration import TwinRegistration, TwinRegistrationProperty
|
|
17
|
-
from .trigger import Trigger
|
|
17
|
+
from .trigger import Trigger, validate_trigger_branch
|
|
18
18
|
from .group_system import GroupSystem
|
|
19
19
|
from .bucket import Bucket
|
|
20
20
|
|
|
@@ -1,8 +1,45 @@
|
|
|
1
|
+
import re
|
|
1
2
|
import uuid
|
|
2
3
|
import json
|
|
3
4
|
from .api_dto import ApiDto
|
|
4
5
|
|
|
5
6
|
|
|
7
|
+
# Mirrors BranchNamer._release_re in wizata_ds_gitstore/branches.py (the source of
|
|
8
|
+
# truth for branch naming). Duplicated as a pure regex on purpose: importing
|
|
9
|
+
# wizata_ds_gitstore pulls pygit2 through its package __init__, which this public
|
|
10
|
+
# package must not depend on.
|
|
11
|
+
RELEASE_BRANCH_RE = re.compile(r"^release/[A-Za-z0-9_\-\.]{1,64}$")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def validate_trigger_branch(branch):
|
|
15
|
+
"""
|
|
16
|
+
Check a value destined for `Trigger.branch` (DEV-5962 / DEV-5966).
|
|
17
|
+
|
|
18
|
+
A schedule must pin a version that cannot move under it: a `release/<name>`
|
|
19
|
+
branch is fast-forward-only and never rewound, whereas master changes every
|
|
20
|
+
time anyone publishes — a trigger on master would silently change what
|
|
21
|
+
production executes. Feature branches are ephemeral (deleted on publish), so
|
|
22
|
+
they are refused too. An image-based trigger carries no branch at all.
|
|
23
|
+
|
|
24
|
+
Call this on WRITE only (`TriggerClient.create` / `update`). It is deliberately
|
|
25
|
+
NOT called from `from_json`: validating on the read path is what made a single
|
|
26
|
+
bad row break `GET /dsapi/twins/` (DEV-5970).
|
|
27
|
+
|
|
28
|
+
:param branch: branch value or None (None is valid — image or legacy trigger).
|
|
29
|
+
:raise ValueError: when branch is set but is not a release branch.
|
|
30
|
+
"""
|
|
31
|
+
if branch is None:
|
|
32
|
+
return None
|
|
33
|
+
branch = str(branch)
|
|
34
|
+
if RELEASE_BRANCH_RE.match(branch) is None:
|
|
35
|
+
raise ValueError(
|
|
36
|
+
f"a trigger can only run a release branch, got {branch!r} — "
|
|
37
|
+
f"publish and cut a release/<name> first (master moves, feature "
|
|
38
|
+
f"branches are deleted on publish)"
|
|
39
|
+
)
|
|
40
|
+
return branch
|
|
41
|
+
|
|
42
|
+
|
|
6
43
|
class Trigger(ApiDto):
|
|
7
44
|
"""
|
|
8
45
|
trigger defines how pipelines are automatically executed.
|
|
@@ -14,6 +51,12 @@ class Trigger(ApiDto):
|
|
|
14
51
|
:ivar uuid.UUID template_id: set a template id to trigger.
|
|
15
52
|
:ivar dict properties: set a dict of properties to pass when triggering the pipeline.
|
|
16
53
|
:ivar list twin_ids: set a list of twin ids on which executed the pipelines (must be registered on the pipeline).
|
|
54
|
+
:ivar str branch: git release branch this schedule runs (`release/<name>`), None for an
|
|
55
|
+
image-based or non-git trigger.
|
|
56
|
+
:ivar str version: runner runtime this schedule executes on (e.g. `3.12`, `3.12-julia`)
|
|
57
|
+
— same meaning as `ExecutionLog.version`, hence the same attribute name here. The
|
|
58
|
+
backend calls it `pythonVersion` on the wire, and the front-end presents it as
|
|
59
|
+
"Environment".
|
|
17
60
|
:ivar uuid.UUID createdById: unique identifier of creating user.
|
|
18
61
|
:ivar int createdDate: timestamp of created date.
|
|
19
62
|
:ivar uuid.UUID updatedById: unique identifier of updating user.
|
|
@@ -38,7 +81,9 @@ class Trigger(ApiDto):
|
|
|
38
81
|
pipeline_image_id: str = None,
|
|
39
82
|
template_id: uuid.UUID = None,
|
|
40
83
|
properties: dict = None,
|
|
41
|
-
twin_ids: list = None
|
|
84
|
+
twin_ids: list = None,
|
|
85
|
+
branch: str = None,
|
|
86
|
+
version: str = None):
|
|
42
87
|
if trigger_id is None:
|
|
43
88
|
trigger_id = uuid.uuid4()
|
|
44
89
|
self.trigger_id = trigger_id
|
|
@@ -49,6 +94,8 @@ class Trigger(ApiDto):
|
|
|
49
94
|
self.template_id = template_id
|
|
50
95
|
self.properties = properties
|
|
51
96
|
self.twin_ids = twin_ids
|
|
97
|
+
self.branch = branch
|
|
98
|
+
self.version = version
|
|
52
99
|
self.createdById = None
|
|
53
100
|
self.createdDate = None
|
|
54
101
|
self.updatedById = None
|
|
@@ -82,6 +129,15 @@ class Trigger(ApiDto):
|
|
|
82
129
|
else:
|
|
83
130
|
self.properties = obj["jsonProperties"]
|
|
84
131
|
|
|
132
|
+
# DEV-5966: the version the schedule runs and the runtime it runs on. Both
|
|
133
|
+
# exist on the backend (`pythonVersion` has always been there and drives the
|
|
134
|
+
# runner queue; `branch` arrived with DEV-5962) but neither was mapped here,
|
|
135
|
+
# so they were silently dropped in both directions.
|
|
136
|
+
if "branch" in obj.keys() and obj["branch"] is not None:
|
|
137
|
+
self.branch = str(obj["branch"])
|
|
138
|
+
if "pythonVersion" in obj.keys() and obj["pythonVersion"] is not None:
|
|
139
|
+
self.version = str(obj["pythonVersion"])
|
|
140
|
+
|
|
85
141
|
if "twinIds" in obj.keys() and isinstance(obj["twinIds"], list):
|
|
86
142
|
self.twin_ids = []
|
|
87
143
|
for twinId in obj["twinIds"]:
|
|
@@ -114,6 +170,11 @@ class Trigger(ApiDto):
|
|
|
114
170
|
if self.pipeline_image_id is not None:
|
|
115
171
|
obj["pipelineImageId"] = str(self.pipeline_image_id)
|
|
116
172
|
|
|
173
|
+
if self.branch is not None:
|
|
174
|
+
obj["branch"] = str(self.branch)
|
|
175
|
+
if self.version is not None:
|
|
176
|
+
obj["pythonVersion"] = str(self.version)
|
|
177
|
+
|
|
117
178
|
if self.properties is not None:
|
|
118
179
|
obj["jsonProperties"] = json.dumps(self.properties)
|
|
119
180
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.1.0.dev12"
|
|
@@ -1924,19 +1924,24 @@ class WizataDSAPIClient(ApiInterface, ApiDtoInterface):
|
|
|
1924
1924
|
)
|
|
1925
1925
|
return response.text
|
|
1926
1926
|
|
|
1927
|
-
def build_image(self, key: str) -> str:
|
|
1927
|
+
def build_image(self, key: str, branch: str = None) -> str:
|
|
1928
1928
|
"""
|
|
1929
1929
|
build an image of a pipeline, store it on the image repository and return its pipeline image id.
|
|
1930
1930
|
:param key: pipeline key.
|
|
1931
|
+
:param branch: release branch (`release/<name>`) to freeze the image from.
|
|
1932
|
+
REQUIRED when the tenant has git enabled — the pipeline definition and
|
|
1933
|
+
the raw script sources are both read at that commit, and the resolved
|
|
1934
|
+
sha is recorded in the image (DEV-5965). Ignored when git is disabled.
|
|
1931
1935
|
:return: image id.
|
|
1932
1936
|
"""
|
|
1937
|
+
payload = {'key': key}
|
|
1938
|
+
if branch is not None:
|
|
1939
|
+
payload['git_ref'] = branch
|
|
1933
1940
|
response = self._process_request(
|
|
1934
1941
|
method="POST",
|
|
1935
1942
|
route=PipelineImage.route() + "/",
|
|
1936
1943
|
dto_class=PipelineImage,
|
|
1937
|
-
data=json.dumps(
|
|
1938
|
-
'key': key
|
|
1939
|
-
})
|
|
1944
|
+
data=json.dumps(payload)
|
|
1940
1945
|
)
|
|
1941
1946
|
return response.json()["id"]
|
|
1942
1947
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.1.0.dev10"
|
|
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
|
|
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
|
|
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
|
{wizata_dsapi-2.1.0.dev10 → wizata_dsapi-2.1.0.dev12}/wizata_dsapi.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|