craft-ai-sdk 0.66.1__py3-none-any.whl → 0.67.0__py3-none-any.whl
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 craft-ai-sdk might be problematic. Click here for more details.
- craft_ai_sdk/__init__.py +1 -1
- craft_ai_sdk/core/deployments.py +55 -58
- craft_ai_sdk/core/pipeline_executions.py +12 -12
- craft_ai_sdk/core/pipeline_metrics.py +6 -6
- craft_ai_sdk/core/steps.py +7 -0
- craft_ai_sdk/sdk.py +16 -16
- {craft_ai_sdk-0.66.1.dist-info → craft_ai_sdk-0.67.0.dist-info}/METADATA +1 -1
- {craft_ai_sdk-0.66.1.dist-info → craft_ai_sdk-0.67.0.dist-info}/RECORD +11 -11
- {craft_ai_sdk-0.66.1.dist-info → craft_ai_sdk-0.67.0.dist-info}/LICENSE +0 -0
- {craft_ai_sdk-0.66.1.dist-info → craft_ai_sdk-0.67.0.dist-info}/WHEEL +0 -0
- {craft_ai_sdk-0.66.1.dist-info → craft_ai_sdk-0.67.0.dist-info}/entry_points.txt +0 -0
craft_ai_sdk/__init__.py
CHANGED
craft_ai_sdk/core/deployments.py
CHANGED
|
@@ -156,8 +156,9 @@ def create_deployment(
|
|
|
156
156
|
automatically adapt to the number of executions. During the lifetime
|
|
157
157
|
of a deployment, a pod may be re-created by the platform for
|
|
158
158
|
technical reasons (including if it tries to use more memory than
|
|
159
|
-
available). This mode is not compatible with
|
|
160
|
-
``container_config.dockerfile_path`` property in
|
|
159
|
+
available). This mode is not compatible with pipelines created with a
|
|
160
|
+
``container_config.dockerfile_path`` property in
|
|
161
|
+
:func:`create_pipeline`.
|
|
161
162
|
|
|
162
163
|
schedule (:obj:`str`, optional): Schedule of the deployment. Required and
|
|
163
164
|
applicable only if ``execution_rule`` is ``"periodic"``. Must be a valid
|
|
@@ -184,19 +185,15 @@ def create_deployment(
|
|
|
184
185
|
List of input mappings, to map pipeline inputs to different
|
|
185
186
|
sources (such as constant values, endpoint inputs, or environment
|
|
186
187
|
variables). See :class:`InputSource` for more details.
|
|
187
|
-
For endpoint rules, if an input of the
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
For periodic rules, all inputs of the step in the pipeline must be
|
|
191
|
-
explicitly mapped.
|
|
188
|
+
For endpoint rules, if an input of the pipeline is not explicitly mapped, it
|
|
189
|
+
will be automatically mapped to an endpoint input with the same name.
|
|
190
|
+
For periodic rules, all inputs of the pipeline must be explicitly mapped.
|
|
192
191
|
outputs_mapping(:obj:`list` of instances of :class:`OutputDestination`):
|
|
193
192
|
List of output mappings, to map pipeline outputs to different
|
|
194
193
|
destinations. See :class:`OutputDestination` for more details.
|
|
195
|
-
For endpoint rules, if an output of the
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
For periodic rules, all outputs of the step in the pipeline must be
|
|
199
|
-
explicitly mapped.
|
|
194
|
+
For endpoint rules, if an output of the pipeline is not explicitly mapped,
|
|
195
|
+
it will be automatically mapped to an endpoint output with the same name.
|
|
196
|
+
For periodic rules, all outputs of the pipeline must be explicitly mapped.
|
|
200
197
|
description (:obj:`str`, optional): Description of the deployment.
|
|
201
198
|
enable_parallel_executions (:obj:`bool`, optional):
|
|
202
199
|
.. _enable_parallel_executions:
|
|
@@ -263,44 +260,44 @@ def create_deployment(
|
|
|
263
260
|
* ``"inputs_mapping"`` (:obj:`list` of :obj:`dict`): List of inputs
|
|
264
261
|
mapping represented as :obj:`dict` with the following keys:
|
|
265
262
|
|
|
266
|
-
* ``"pipeline_input_name"`` (:obj:`str`): Name of the
|
|
267
|
-
* ``"data_type"`` (:obj:`str`): Data type of the
|
|
268
|
-
* ``"description"`` (:obj:`str`): Description of the
|
|
269
|
-
* ``"constant_value"`` (:obj:`str`): Constant value of the
|
|
270
|
-
Note that this key is only returned if the
|
|
263
|
+
* ``"pipeline_input_name"`` (:obj:`str`): Name of the pipeline input.
|
|
264
|
+
* ``"data_type"`` (:obj:`str`): Data type of the pipeline input.
|
|
265
|
+
* ``"description"`` (:obj:`str`): Description of the pipeline input.
|
|
266
|
+
* ``"constant_value"`` (:obj:`str`): Constant value of the pipeline input.
|
|
267
|
+
Note that this key is only returned if the pipeline input is mapped to a
|
|
271
268
|
constant value.
|
|
272
269
|
* ``"environment_variable_name"`` (:obj:`str`): Name of the environment
|
|
273
|
-
variable. Note that this key is only returned if the
|
|
270
|
+
variable. Note that this key is only returned if the pipeline input is
|
|
274
271
|
mapped to an environment variable.
|
|
275
272
|
* ``"endpoint_input_name"`` (:obj:`str`): Name of the endpoint input.
|
|
276
|
-
Note that this key is only returned if the
|
|
273
|
+
Note that this key is only returned if the pipeline input is mapped to an
|
|
277
274
|
endpoint input.
|
|
278
|
-
* ``"is_null"`` (:obj:`bool`): Whether the
|
|
279
|
-
Note that this key is only returned if the
|
|
275
|
+
* ``"is_null"`` (:obj:`bool`): Whether the pipeline input is mapped to null.
|
|
276
|
+
Note that this key is only returned if the pipeline input is mapped to
|
|
280
277
|
null.
|
|
281
|
-
* ``"datastore_path"`` (:obj:`str`): Datastore path of the
|
|
282
|
-
Note that this key is only returned if the
|
|
278
|
+
* ``"datastore_path"`` (:obj:`str`): Datastore path of the pipeline input.
|
|
279
|
+
Note that this key is only returned if the pipeline input is mapped to the
|
|
283
280
|
datastore.
|
|
284
|
-
* ``"is_required"`` (:obj:`bool`): Whether the
|
|
285
|
-
Note that this key is only returned if the
|
|
286
|
-
* ``"default_value"`` (:obj:`str`): Default value of the
|
|
287
|
-
Note that this key is only returned if the
|
|
281
|
+
* ``"is_required"`` (:obj:`bool`): Whether the pipeline input is required.
|
|
282
|
+
Note that this key is only returned if the pipeline input is required.
|
|
283
|
+
* ``"default_value"`` (:obj:`str`): Default value of the pipeline input.
|
|
284
|
+
Note that this key is only returned if the pipeline input has a default
|
|
288
285
|
value.
|
|
289
286
|
|
|
290
287
|
* ``"outputs_mapping"`` (:obj:`list` of :obj:`dict`): List of outputs
|
|
291
288
|
mapping represented as :obj:`dict` with the following keys:
|
|
292
289
|
|
|
293
|
-
* ``"pipeline_output_name"`` (:obj:`str`): Name of the
|
|
294
|
-
* ``"data_type"`` (:obj:`str`): Data type of the
|
|
295
|
-
* ``"description"`` (:obj:`str`): Description of the
|
|
290
|
+
* ``"pipeline_output_name"`` (:obj:`str`): Name of the pipeline output.
|
|
291
|
+
* ``"data_type"`` (:obj:`str`): Data type of the pipeline output.
|
|
292
|
+
* ``"description"`` (:obj:`str`): Description of the pipeline output.
|
|
296
293
|
* ``"endpoint_output_name"`` (:obj:`str`): Name of the endpoint output.
|
|
297
|
-
Note that this key is only returned if the
|
|
294
|
+
Note that this key is only returned if the pipeline output is mapped to an
|
|
298
295
|
endpoint output.
|
|
299
|
-
* ``"is_null"`` (:obj:`bool`): Whether the
|
|
300
|
-
Note that this key is only returned if the
|
|
296
|
+
* ``"is_null"`` (:obj:`bool`): Whether the pipeline output is mapped to null.
|
|
297
|
+
Note that this key is only returned if the pipeline output is mapped to
|
|
301
298
|
null.
|
|
302
|
-
* ``"datastore_path"`` (:obj:`str`): Datastore path of the
|
|
303
|
-
Note that this key is only returned if the
|
|
299
|
+
* ``"datastore_path"`` (:obj:`str`): Datastore path of the pipeline output.
|
|
300
|
+
Note that this key is only returned if the pipeline output is mapped to
|
|
304
301
|
the datastore.
|
|
305
302
|
|
|
306
303
|
* ``"endpoint_token"`` (:obj:`str`): Token of the endpoint. Note that this
|
|
@@ -523,44 +520,44 @@ def get_deployment(
|
|
|
523
520
|
* ``"inputs_mapping"`` (:obj:`list` of :obj:`dict`): List of inputs
|
|
524
521
|
mapping represented as :obj:`dict` with the following keys:
|
|
525
522
|
|
|
526
|
-
* ``"pipeline_input_name"`` (:obj:`str`): Name of the
|
|
527
|
-
* ``"data_type"`` (:obj:`str`): Data type of the
|
|
528
|
-
* ``"description"`` (:obj:`str`): Description of the
|
|
529
|
-
* ``"constant_value"`` (:obj:`str`): Constant value of the
|
|
530
|
-
Note that this key is only returned if the
|
|
523
|
+
* ``"pipeline_input_name"`` (:obj:`str`): Name of the pipeline input.
|
|
524
|
+
* ``"data_type"`` (:obj:`str`): Data type of the pipeline input.
|
|
525
|
+
* ``"description"`` (:obj:`str`): Description of the pipeline input.
|
|
526
|
+
* ``"constant_value"`` (:obj:`str`): Constant value of the pipeline input.
|
|
527
|
+
Note that this key is only returned if the pipeline input is mapped to a
|
|
531
528
|
constant value.
|
|
532
529
|
* ``"environment_variable_name"`` (:obj:`str`): Name of the environment
|
|
533
|
-
variable. Note that this key is only returned if the
|
|
530
|
+
variable. Note that this key is only returned if the pipeline input is
|
|
534
531
|
mapped to an environment variable.
|
|
535
532
|
* ``"endpoint_input_name"`` (:obj:`str`): Name of the endpoint input.
|
|
536
|
-
Note that this key is only returned if the
|
|
533
|
+
Note that this key is only returned if the pipeline input is mapped to an
|
|
537
534
|
endpoint input.
|
|
538
|
-
* ``"is_null"`` (:obj:`bool`): Whether the
|
|
539
|
-
Note that this key is only returned if the
|
|
535
|
+
* ``"is_null"`` (:obj:`bool`): Whether the pipeline input is mapped to null.
|
|
536
|
+
Note that this key is only returned if the pipeline input is mapped to
|
|
540
537
|
null.
|
|
541
|
-
* ``"datastore_path"`` (:obj:`str`): Datastore path of the
|
|
542
|
-
Note that this key is only returned if the
|
|
538
|
+
* ``"datastore_path"`` (:obj:`str`): Datastore path of the pipeline input.
|
|
539
|
+
Note that this key is only returned if the pipeline input is mapped to the
|
|
543
540
|
datastore.
|
|
544
|
-
* ``"is_required"`` (:obj:`bool`): Whether the
|
|
545
|
-
Note that this key is only returned if the
|
|
546
|
-
* ``"default_value"`` (:obj:`str`): Default value of the
|
|
547
|
-
Note that this key is only returned if the
|
|
541
|
+
* ``"is_required"`` (:obj:`bool`): Whether the pipeline input is required.
|
|
542
|
+
Note that this key is only returned if the pipeline input is required.
|
|
543
|
+
* ``"default_value"`` (:obj:`str`): Default value of the pipeline input.
|
|
544
|
+
Note that this key is only returned if the pipeline input has a default
|
|
548
545
|
value.
|
|
549
546
|
|
|
550
547
|
* ``"outputs_mapping"`` (:obj:`list` of :obj:`dict`): List of outputs
|
|
551
548
|
mapping represented as :obj:`dict` with the following keys:
|
|
552
549
|
|
|
553
|
-
* ``"pipeline_output_name"`` (:obj:`str`): Name of the
|
|
554
|
-
* ``"data_type"`` (:obj:`str`): Data type of the
|
|
555
|
-
* ``"description"`` (:obj:`str`): Description of the
|
|
550
|
+
* ``"pipeline_output_name"`` (:obj:`str`): Name of the pipeline output.
|
|
551
|
+
* ``"data_type"`` (:obj:`str`): Data type of the pipeline output.
|
|
552
|
+
* ``"description"`` (:obj:`str`): Description of the pipeline output.
|
|
556
553
|
* ``"endpoint_output_name"`` (:obj:`str`): Name of the endpoint output.
|
|
557
|
-
Note that this key is only returned if the
|
|
554
|
+
Note that this key is only returned if the pipeline output is mapped to an
|
|
558
555
|
endpoint output.
|
|
559
|
-
* ``"is_null"`` (:obj:`bool`): Whether the
|
|
560
|
-
Note that this key is only returned if the
|
|
556
|
+
* ``"is_null"`` (:obj:`bool`): Whether the pipeline output is mapped to null.
|
|
557
|
+
Note that this key is only returned if the pipeline output is mapped to
|
|
561
558
|
null.
|
|
562
|
-
* ``"datastore_path"`` (:obj:`str`): Datastore path of the
|
|
563
|
-
Note that this key is only returned if the
|
|
559
|
+
* ``"datastore_path"`` (:obj:`str`): Datastore path of the pipeline output.
|
|
560
|
+
Note that this key is only returned if the pipeline output is mapped to
|
|
564
561
|
the datastore.
|
|
565
562
|
* ``"endpoint_token"`` (:obj:`str`): Token of the deployment. Note that this
|
|
566
563
|
key is only returned if the ``execution_rule`` of the deployment is
|
|
@@ -236,21 +236,21 @@ def get_pipeline_execution(sdk: BaseCraftAiSdk, execution_id):
|
|
|
236
236
|
execution.
|
|
237
237
|
* ``"deployment_name"`` (:obj:`str`): Name of the deployment used for the
|
|
238
238
|
execution.
|
|
239
|
-
* ``"steps"`` (:obj:`list` of `obj`): List of the
|
|
239
|
+
* ``"steps"`` (:obj:`list` of `obj`): List of the pipeline executions
|
|
240
240
|
represented as :obj:`dict` with the following keys:
|
|
241
241
|
|
|
242
|
-
* ``"name"`` (:obj:`str`): Name of the
|
|
243
|
-
* ``"status"`` (:obj:`str`): Status of the
|
|
244
|
-
* ``"start_date"`` (:obj:`str`): Date of start of the
|
|
245
|
-
* ``"end_date"`` (:obj:`str`): Date of completion of the
|
|
242
|
+
* ``"name"`` (:obj:`str`): Name of the pipeline.
|
|
243
|
+
* ``"status"`` (:obj:`str`): Status of the pipeline.
|
|
244
|
+
* ``"start_date"`` (:obj:`str`): Date of start of the pipeline execution.
|
|
245
|
+
* ``"end_date"`` (:obj:`str`): Date of completion of the pipeline execution.
|
|
246
246
|
* ``"commit_id"`` (:obj:`str`): Id of the commit used to build the
|
|
247
|
-
|
|
247
|
+
pipeline.
|
|
248
248
|
* ``"repository_url"`` (:obj:`str`): Url of the repository used to
|
|
249
|
-
build the
|
|
249
|
+
build the pipeline.
|
|
250
250
|
* ``"repository_branch"`` (:obj:`str`): Branch of the repository used
|
|
251
|
-
to build the
|
|
251
|
+
to build the pipeline.
|
|
252
252
|
* ``"requirements_path"`` (:obj:`str`): Path of the requirements.txt file.
|
|
253
|
-
* ``"origin"`` (:obj:`str`): The origin of the
|
|
253
|
+
* ``"origin"`` (:obj:`str`): The origin of the pipeline, can be
|
|
254
254
|
``"git_repository"`` or ``"local"``.
|
|
255
255
|
* ``"inputs"`` (:obj:`list` of :obj:`dict`): List of inputs represented
|
|
256
256
|
as a dict with the following keys:
|
|
@@ -460,12 +460,12 @@ def get_pipeline_execution_logs(
|
|
|
460
460
|
sdk,
|
|
461
461
|
"Please wait while logs are being fetched. This may take a while...",
|
|
462
462
|
)
|
|
463
|
-
|
|
463
|
+
logs_by_pipelines = sdk._post(url, json=data)
|
|
464
464
|
|
|
465
|
-
if len(
|
|
465
|
+
if len(logs_by_pipelines) == 0:
|
|
466
466
|
return []
|
|
467
467
|
|
|
468
|
-
return
|
|
468
|
+
return logs_by_pipelines[0]
|
|
469
469
|
|
|
470
470
|
|
|
471
471
|
def delete_pipeline_execution(sdk: BaseCraftAiSdk, execution_id):
|
|
@@ -28,7 +28,7 @@ class ListMetric(TypedDict):
|
|
|
28
28
|
@log_func_result("Pipeline metrics definition", get_execution_id)
|
|
29
29
|
def record_metric_value(sdk: BaseCraftAiSdk, name: str, value: float):
|
|
30
30
|
"""Create or update a pipeline metric. Note that this function can only be used
|
|
31
|
-
inside a
|
|
31
|
+
inside a pipeline code.
|
|
32
32
|
|
|
33
33
|
Args:
|
|
34
34
|
name (:obj:`str`): Name of the metric to store.
|
|
@@ -39,9 +39,9 @@ def record_metric_value(sdk: BaseCraftAiSdk, name: str, value: float):
|
|
|
39
39
|
"""
|
|
40
40
|
|
|
41
41
|
if not get_execution_id():
|
|
42
|
-
if sdk.
|
|
42
|
+
if sdk.warn_on_metric_outside_of_pipeline:
|
|
43
43
|
warnings.warn(
|
|
44
|
-
"You cannot send a metric outside a
|
|
44
|
+
"You cannot send a metric outside a pipeline code, the metric has not \
|
|
45
45
|
been sent",
|
|
46
46
|
stacklevel=2,
|
|
47
47
|
)
|
|
@@ -55,7 +55,7 @@ been sent",
|
|
|
55
55
|
@log_func_result("Pipeline list metric definition", get_execution_id)
|
|
56
56
|
def record_list_metric_values(sdk: BaseCraftAiSdk, name: str, values: list[float]):
|
|
57
57
|
"""Add values to a pipeline metric list. Note that this function can only be
|
|
58
|
-
used inside a
|
|
58
|
+
used inside a pipeline code.
|
|
59
59
|
|
|
60
60
|
Args:
|
|
61
61
|
name (:obj:`str`):
|
|
@@ -68,9 +68,9 @@ def record_list_metric_values(sdk: BaseCraftAiSdk, name: str, values: list[float
|
|
|
68
68
|
"""
|
|
69
69
|
|
|
70
70
|
if not get_execution_id():
|
|
71
|
-
if sdk.
|
|
71
|
+
if sdk.warn_on_metric_outside_of_pipeline:
|
|
72
72
|
warnings.warn(
|
|
73
|
-
"You cannot send a metric outside a
|
|
73
|
+
"You cannot send a metric outside a pipeline code, the metric has not \
|
|
74
74
|
been sent",
|
|
75
75
|
stacklevel=2,
|
|
76
76
|
)
|
craft_ai_sdk/core/steps.py
CHANGED
|
@@ -8,6 +8,7 @@ import requests
|
|
|
8
8
|
from typing_extensions import NotRequired
|
|
9
9
|
|
|
10
10
|
from craft_ai_sdk.shared.types import Log
|
|
11
|
+
from craft_ai_sdk.shared.warnings import deprecated
|
|
11
12
|
|
|
12
13
|
from ..constants import CREATION_PARAMETER_VALUE
|
|
13
14
|
from ..io import Input, Output
|
|
@@ -207,6 +208,7 @@ def _remove_id_from_step(step):
|
|
|
207
208
|
|
|
208
209
|
|
|
209
210
|
@log_func_result("Steps creation")
|
|
211
|
+
@deprecated
|
|
210
212
|
def create_step(
|
|
211
213
|
sdk: BaseCraftAiSdk,
|
|
212
214
|
step_name: str,
|
|
@@ -379,6 +381,7 @@ def create_step(
|
|
|
379
381
|
return get_step(sdk, step_name, wait_for_completion, timeout_s)
|
|
380
382
|
|
|
381
383
|
|
|
384
|
+
@deprecated
|
|
382
385
|
def get_step(
|
|
383
386
|
sdk: BaseCraftAiSdk,
|
|
384
387
|
step_name: str,
|
|
@@ -473,6 +476,7 @@ def get_step(
|
|
|
473
476
|
return _remove_id_from_step(step)
|
|
474
477
|
|
|
475
478
|
|
|
479
|
+
@deprecated
|
|
476
480
|
def list_steps(sdk: BaseCraftAiSdk) -> list[StepListItem]:
|
|
477
481
|
"""Get the list of all steps.
|
|
478
482
|
|
|
@@ -490,6 +494,7 @@ def list_steps(sdk: BaseCraftAiSdk) -> list[StepListItem]:
|
|
|
490
494
|
|
|
491
495
|
|
|
492
496
|
@log_func_result("Step deletion")
|
|
497
|
+
@deprecated
|
|
493
498
|
def delete_step(
|
|
494
499
|
sdk: BaseCraftAiSdk, step_name: str, force_dependents_deletion=False
|
|
495
500
|
) -> StepDeleted:
|
|
@@ -522,6 +527,7 @@ def _get_download_presigned_url(sdk: BaseCraftAiSdk, step_name: str) -> str:
|
|
|
522
527
|
|
|
523
528
|
|
|
524
529
|
@log_func_result("Step download")
|
|
530
|
+
@deprecated
|
|
525
531
|
def download_step_local_folder(sdk: BaseCraftAiSdk, step_name: str, folder: str):
|
|
526
532
|
"""Download a step's local folder as a `.tgz` archive.
|
|
527
533
|
|
|
@@ -550,6 +556,7 @@ def download_step_local_folder(sdk: BaseCraftAiSdk, step_name: str, folder: str)
|
|
|
550
556
|
|
|
551
557
|
|
|
552
558
|
@log_func_result("Step logs")
|
|
559
|
+
@deprecated
|
|
553
560
|
def get_step_logs(
|
|
554
561
|
sdk: BaseCraftAiSdk,
|
|
555
562
|
step_name: str,
|
craft_ai_sdk/sdk.py
CHANGED
|
@@ -24,7 +24,7 @@ class BaseCraftAiSdk(ABC):
|
|
|
24
24
|
_MULTIPART_PART_SIZE: int
|
|
25
25
|
_version: str
|
|
26
26
|
_session: requests.Session
|
|
27
|
-
|
|
27
|
+
warn_on_metric_outside_of_pipeline: bool
|
|
28
28
|
|
|
29
29
|
@abstractmethod
|
|
30
30
|
def _get(self, url: str, params=None, **kwargs) -> Any:
|
|
@@ -57,8 +57,8 @@ class CraftAiSdk(BaseCraftAiSdk):
|
|
|
57
57
|
base_control_api_url (:obj:`str`): Base URL to CraftAI authorization server API.
|
|
58
58
|
verbose_log (bool): If True, information during method execution will be
|
|
59
59
|
printed.
|
|
60
|
-
|
|
61
|
-
a metric is added outside of a
|
|
60
|
+
warn_on_metric_outside_of_pipeline (bool): If True, a warning will be printed
|
|
61
|
+
when a metric is added outside of a pipeline.
|
|
62
62
|
"""
|
|
63
63
|
|
|
64
64
|
from .core.data_store import (
|
|
@@ -139,7 +139,7 @@ class CraftAiSdk(BaseCraftAiSdk):
|
|
|
139
139
|
os.environ.get("CRAFT_AI__MULTIPART_PART_SIZE__B", str(38 * 256 * 1024))
|
|
140
140
|
)
|
|
141
141
|
_access_token_margin = timedelta(seconds=30)
|
|
142
|
-
_version = "0.
|
|
142
|
+
_version = "0.67.0" # Would be better to share it somewhere
|
|
143
143
|
|
|
144
144
|
def __init__(
|
|
145
145
|
self,
|
|
@@ -147,7 +147,7 @@ class CraftAiSdk(BaseCraftAiSdk):
|
|
|
147
147
|
environment_url=None,
|
|
148
148
|
control_url=None,
|
|
149
149
|
verbose_log=None,
|
|
150
|
-
|
|
150
|
+
warn_on_metric_outside_of_pipeline=True,
|
|
151
151
|
):
|
|
152
152
|
"""Inits CraftAiSdk.
|
|
153
153
|
|
|
@@ -166,8 +166,8 @@ class CraftAiSdk(BaseCraftAiSdk):
|
|
|
166
166
|
Defaults to ``True`` if the environment variable ``SDK_VERBOSE_LOG`` is
|
|
167
167
|
set to ``true``; ``False`` if it is set to ``false``; else, defaults to
|
|
168
168
|
``True`` in interactive mode; ``False`` otherwise.
|
|
169
|
-
|
|
170
|
-
warning will be raised when a metric is added outside of a
|
|
169
|
+
warn_on_metric_outside_of_pipeline (:obj:`bool`, optional): If ``True``, a
|
|
170
|
+
warning will be raised when a metric is added outside of a pipeline.
|
|
171
171
|
Defaults to ``True``.
|
|
172
172
|
|
|
173
173
|
Raises:
|
|
@@ -222,8 +222,8 @@ class CraftAiSdk(BaseCraftAiSdk):
|
|
|
222
222
|
)
|
|
223
223
|
self.verbose_log = verbose_log
|
|
224
224
|
|
|
225
|
-
# Set
|
|
226
|
-
self.
|
|
225
|
+
# Set warn_on_metric_outside_of_pipeline
|
|
226
|
+
self.warn_on_metric_outside_of_pipeline = warn_on_metric_outside_of_pipeline
|
|
227
227
|
|
|
228
228
|
# _____ REQUESTS METHODS _____
|
|
229
229
|
|
|
@@ -305,13 +305,13 @@ class CraftAiSdk(BaseCraftAiSdk):
|
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
@property
|
|
308
|
-
def
|
|
308
|
+
def warn_on_metric_outside_of_pipeline(self):
|
|
309
309
|
"""Whether a warning should be raised when a metric is added outside of a
|
|
310
|
-
|
|
311
|
-
return self.
|
|
310
|
+
pipeline."""
|
|
311
|
+
return self._warn_on_metric_outside_of_pipeline
|
|
312
312
|
|
|
313
|
-
@
|
|
314
|
-
def
|
|
313
|
+
@warn_on_metric_outside_of_pipeline.setter
|
|
314
|
+
def warn_on_metric_outside_of_pipeline(self, value):
|
|
315
315
|
if not isinstance(value, bool):
|
|
316
|
-
raise TypeError("
|
|
317
|
-
self.
|
|
316
|
+
raise TypeError("warn_on_metric_outside_of_pipeline must be a boolean")
|
|
317
|
+
self._warn_on_metric_outside_of_pipeline = value
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
craft_ai_sdk/__init__.py,sha256=
|
|
1
|
+
craft_ai_sdk/__init__.py,sha256=V68rIQiiFuvuQCyFo34UlPjXg-T4QbDb4xDwis7eYRw,363
|
|
2
2
|
craft_ai_sdk/constants.py,sha256=rH4JrGlTpbjjjNRrKhk5oScbj5G5INrcVza6Bb6kIzY,980
|
|
3
3
|
craft_ai_sdk/core/data_store.py,sha256=dlVZajXGwcI_4mzqFctHpzKO-uySIP5lvQaJy6CKwY0,9131
|
|
4
|
-
craft_ai_sdk/core/deployments.py,sha256=
|
|
4
|
+
craft_ai_sdk/core/deployments.py,sha256=Hig0Z6tZXbaLxms9ENtKI4OG3ki7G4Iz3wGk2V2Gmfg,37731
|
|
5
5
|
craft_ai_sdk/core/endpoints.py,sha256=ad8_oHVCwrTpnlrlqvEcO48nXbzmuWTaUbh82JdRX6g,8018
|
|
6
6
|
craft_ai_sdk/core/environment_variables.py,sha256=CpkyneLf8UF-1QXe36Ay_RZJ8grSfbZZWBvGSQzKlLs,2221
|
|
7
|
-
craft_ai_sdk/core/pipeline_executions.py,sha256=
|
|
8
|
-
craft_ai_sdk/core/pipeline_metrics.py,sha256=
|
|
7
|
+
craft_ai_sdk/core/pipeline_executions.py,sha256=EfhNDzWiKro9-gDUPHJFMFcdPXtznlJo2leFKLloDmA,18709
|
|
8
|
+
craft_ai_sdk/core/pipeline_metrics.py,sha256=AYxF5HpLCfTYK-TydEHswaAHat3N9NiOTHpPd_R9-rY,7190
|
|
9
9
|
craft_ai_sdk/core/pipelines.py,sha256=msH3hzb5iH7SRKfMNRSyZmouhK-TsxoWScHfJnWSBrk,21812
|
|
10
10
|
craft_ai_sdk/core/resource_metrics.py,sha256=ubCe6QOhud3f-EQr_TXKBsrFFaxZubqTS3fZqfV7kgg,3457
|
|
11
|
-
craft_ai_sdk/core/steps.py,sha256=
|
|
11
|
+
craft_ai_sdk/core/steps.py,sha256=TwOWXAAVpLPuSZ_gvf-3E5uKEvfGIzR52Y58bqKn_Ds,23487
|
|
12
12
|
craft_ai_sdk/core/users.py,sha256=q5et87q0SOMpRTBOiLX026oaEOTaY1aGqKdbUC51zbA,618
|
|
13
13
|
craft_ai_sdk/core/vector_database.py,sha256=S3h68Ej1FnHYJdc5LdLlNjobYYdmaCloSq2UaylPWko,2334
|
|
14
14
|
craft_ai_sdk/exceptions.py,sha256=IC-JfZmmmaTsbMCgirOEByRmWnatQLjKe8BErRkuwM0,1075
|
|
15
15
|
craft_ai_sdk/io.py,sha256=x1G7ga10W_SeTDLHe-FrhU26_WNwWW32-yprMmCZ5Ck,11836
|
|
16
|
-
craft_ai_sdk/sdk.py,sha256=
|
|
16
|
+
craft_ai_sdk/sdk.py,sha256=_u1IGl-3hfUFALTwWnQHLBQbS5_dpLlKpBTrWlSWsEY,10907
|
|
17
17
|
craft_ai_sdk/shared/authentication.py,sha256=5lJS_aNphkgI0-wvHFK4aW316ZRfOq9oywNpv-Oyn2M,1062
|
|
18
18
|
craft_ai_sdk/shared/environments.py,sha256=LbpRK-ACpwFfN7WTuo0nrtbbi2NAXhuMRKf7YkktEYI,510
|
|
19
19
|
craft_ai_sdk/shared/execution_context.py,sha256=B2Ghq-wiUvq81q5mhsm79Oc59c8c00uQxMIpApFD03o,585
|
|
@@ -26,8 +26,8 @@ craft_ai_sdk/utils/__init__.py,sha256=A0sLCXSPD1Z3q2GP1uLDjvif4ivOr__Hzg9RQysEuq
|
|
|
26
26
|
craft_ai_sdk/utils/datetime_utils.py,sha256=yYP5HVdI879WXxQCajPTnas1pWrwInOxMux-mxqQNQM,734
|
|
27
27
|
craft_ai_sdk/utils/dict_utils.py,sha256=1HQ3A14SN48XPFDmQleujGAgksmkjIs3hyPLpwhwh24,748
|
|
28
28
|
craft_ai_sdk/utils/file_utils.py,sha256=o10-CDt4qzgCJNPykvlNrL6WTouhVLY8C8BVpHJYt18,2795
|
|
29
|
-
craft_ai_sdk-0.
|
|
30
|
-
craft_ai_sdk-0.
|
|
31
|
-
craft_ai_sdk-0.
|
|
32
|
-
craft_ai_sdk-0.
|
|
33
|
-
craft_ai_sdk-0.
|
|
29
|
+
craft_ai_sdk-0.67.0.dist-info/LICENSE,sha256=_2oYRJic9lZK05LceuJ9aZZw5mPHYc1WQhJiVS-oGFU,10754
|
|
30
|
+
craft_ai_sdk-0.67.0.dist-info/METADATA,sha256=8trq_RXp9J2_VQ5KY9sigfz4TtprZYzBcQR9sSuS6io,1676
|
|
31
|
+
craft_ai_sdk-0.67.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
32
|
+
craft_ai_sdk-0.67.0.dist-info/entry_points.txt,sha256=QC96WcXvvUfLMRgFD-l_y7_TgC9SqZybLs9EQ8dsGiQ,417
|
|
33
|
+
craft_ai_sdk-0.67.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|