craft-ai-sdk 0.56.0__py3-none-any.whl → 0.57.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 CHANGED
@@ -14,4 +14,4 @@ from .io import ( # noqa: F401
14
14
  )
15
15
 
16
16
 
17
- __version__ = "0.56.0"
17
+ __version__ = "0.57.0"
@@ -529,10 +529,14 @@ def get_deployment(
529
529
  deployment_status = deployment.get("status", None)
530
530
  elapsed_time = sdk._get_time() - start_time
531
531
 
532
- if deployment_status not in [
533
- DEPLOYMENT_STATUS.UP,
534
- DEPLOYMENT_STATUS.CREATION_FAILED,
535
- ]:
532
+ if deployment_status == DEPLOYMENT_STATUS.CREATION_FAILED:
533
+ raise SdkException(
534
+ "The deployment creation failed. Please check the logs for more \
535
+ details.",
536
+ name="CreationFailedException",
537
+ )
538
+
539
+ if deployment_status != DEPLOYMENT_STATUS.UP:
536
540
  raise SdkException(
537
541
  'The deployment was not ready in time. It is still being created but \
538
542
  this function stopped trying. Please check its status with "get_deployment" with \
@@ -579,6 +583,8 @@ def get_deployment_logs(
579
583
 
580
584
  * ``"timestamp"`` (:obj:`str`): Timestamp of the log.
581
585
  * ``"message"`` (:obj:`str`): Message of the log.
586
+ * ``"stream"`` (:obj:`str`): Stream of the log. Typically, ``"stdout"`` or
587
+ ``"stderr"``
582
588
  * ``"pod_id"`` (:obj:`str`): ID of the pod.
583
589
  * ``"type"`` (:obj:`str`): Type of the log. Can be ``"deployment"``.
584
590
  """
@@ -2,7 +2,6 @@ import warnings
2
2
  import os
3
3
  import requests
4
4
 
5
- from ..exceptions import SdkException
6
5
  from ..sdk import BaseCraftAiSdk
7
6
  from ..utils import (
8
7
  log_action,
@@ -312,25 +311,20 @@ def get_pipeline(
312
311
  * ``"last_execution_id"`` (:obj:`str`): The id of the last execution of
313
312
  the pipeline.
314
313
  """
315
- try:
316
- base_url = f"{sdk.base_environment_api_url}/pipelines/{pipeline_name}"
317
- if wait_for_completion:
318
- pipeline = _wait_create_until_ready(
319
- sdk,
320
- pipeline_name,
321
- lambda sdk, _: sdk._get(
322
- f"{base_url}?wait_for_completion=true", allow_redirects=False
323
- ),
324
- timeout_s,
325
- sdk._get_time(),
326
- get_pipeline_logs,
327
- )
328
- else:
329
- pipeline = sdk._get(base_url)
330
- except SdkException as error:
331
- if error.status_code == 404:
332
- return None
333
- raise error
314
+ base_url = f"{sdk.base_environment_api_url}/pipelines/{pipeline_name}"
315
+ if wait_for_completion:
316
+ pipeline = _wait_create_until_ready(
317
+ sdk,
318
+ pipeline_name,
319
+ lambda sdk, _: sdk._get(
320
+ f"{base_url}?wait_for_completion=true", allow_redirects=False
321
+ ),
322
+ timeout_s,
323
+ sdk._get_time(),
324
+ get_pipeline_logs,
325
+ )
326
+ else:
327
+ pipeline = sdk._get(base_url)
334
328
 
335
329
  latest_execution = sdk._get(
336
330
  f"{sdk.base_environment_api_url}/pipelines/{pipeline_name}/executions/latest"
craft_ai_sdk/sdk.py CHANGED
@@ -130,7 +130,7 @@ class CraftAiSdk(BaseCraftAiSdk):
130
130
  os.environ.get("CRAFT_AI__MULTIPART_PART_SIZE__B", str(38 * 256 * 1024))
131
131
  )
132
132
  _access_token_margin = timedelta(seconds=30)
133
- _version = "0.56.0" # Would be better to share it somewhere
133
+ _version = "0.57.0" # Would be better to share it somewhere
134
134
 
135
135
  def __init__(
136
136
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: craft-ai-sdk
3
- Version: 0.56.0
3
+ Version: 0.57.0
4
4
  Summary: Craft AI MLOps platform SDK
5
5
  Home-page: https://www.craft.ai/
6
6
  License: Apache-2.0
@@ -1,23 +1,23 @@
1
- craft_ai_sdk/__init__.py,sha256=YnT2RXICGR9rmJ8DbmrGMsyx_99wdRPApKuckgUlq-s,404
1
+ craft_ai_sdk/__init__.py,sha256=JAsPpy1v4wuMAgpJxCpgwih5gED20EioFytwYg75d-o,404
2
2
  craft_ai_sdk/constants.py,sha256=5dR4JfKVz3KhBKRFSdN1nrb06kFkNiYP2mRnacsbzJA,629
3
3
  craft_ai_sdk/core/data_store.py,sha256=USONqCEwG_KoTv5a1fgZJmi7FIjbfo4Vi-zq82keo4E,8511
4
- craft_ai_sdk/core/deployments.py,sha256=fUZBHTgOWHPShMcIvNF7XEHJLAZJwJI8zLzMtdv-Dzc,31427
4
+ craft_ai_sdk/core/deployments.py,sha256=u1xIo7wyaJM84Mt11lgImo1QGBLKTblyEJrcokioQig,31712
5
5
  craft_ai_sdk/core/endpoints.py,sha256=ggJ8IU0QVrGa7A0RBWiJY1Lo7Klfi9BbfGnovZD97FQ,4592
6
6
  craft_ai_sdk/core/environment_variables.py,sha256=wy0U7y0C7tRXOXOiWGz0vX5ajHSmOb_7J1fXlSahGpI,2045
7
7
  craft_ai_sdk/core/pipeline_executions.py,sha256=-ClmW3qtPIA9LIhs_tiECCPL6ykSmG2zMLnrBNDGZiU,18665
8
8
  craft_ai_sdk/core/pipeline_metrics.py,sha256=Tt5p6guHAf7nhq1wvJG3t7WqsYKqrNQ7sZcFKqXYmdM,6465
9
- craft_ai_sdk/core/pipelines.py,sha256=r-wTMDvH6D_4gDMjjWzjGYQdph6vv_DO8uh0wlec9S8,20331
9
+ craft_ai_sdk/core/pipelines.py,sha256=EgqfPuhv95nuy5lymBDmFv9-c51PXrWfTAZ8VcbhHBI,20113
10
10
  craft_ai_sdk/core/resource_metrics.py,sha256=yaco_AZ4Wu5sxLRKsA3qt2R3-PMs2e32EGO0gsHtq2Y,2336
11
11
  craft_ai_sdk/core/steps.py,sha256=1yTqcGrAKkVQWzslLjz2XQ3I7hILq8Oyc11Z9FeuFk0,20217
12
12
  craft_ai_sdk/core/users.py,sha256=Qi3xg7Vzk_0MepccNIZbFzjI0bBqouqkFStTuejUY6s,509
13
13
  craft_ai_sdk/exceptions.py,sha256=IC-JfZmmmaTsbMCgirOEByRmWnatQLjKe8BErRkuwM0,1075
14
14
  craft_ai_sdk/io.py,sha256=Jh9bFfXRzwCequXvJ3DKO-SIdZ7teYfzO64N940FyDY,11861
15
- craft_ai_sdk/sdk.py,sha256=lTl_A2TLifv8Qn9tX96pxJfymMdziBtzNIEUM8ycVk8,10068
15
+ craft_ai_sdk/sdk.py,sha256=bhrt9CWTW26_uyH7fcQ2BHaQmB9BonVIxc7TP-8SsSM,10068
16
16
  craft_ai_sdk/utils.py,sha256=syOtpNgV8XF9VoeRVnWGkjIdWv0vyS_Z8RN5QfHCfIo,11891
17
17
  craft_ai_sdk/warnings.py,sha256=xJXbUR66SVbG_ZO7rxpAZ2hkGxdUtM5JAx6JoWg77Qs,6678
18
- documentation.pdf,sha256=9NPdcWoQJcO-Fx4CMppLYnN1tDg7FwP6xYTNxDlX-lk,333575
19
- craft_ai_sdk-0.56.0.dist-info/LICENSE,sha256=_2oYRJic9lZK05LceuJ9aZZw5mPHYc1WQhJiVS-oGFU,10754
20
- craft_ai_sdk-0.56.0.dist-info/METADATA,sha256=src4TBy2Y4PuI3rdO281g6Axclvekh2F2THsYipMV-8,1614
21
- craft_ai_sdk-0.56.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
22
- craft_ai_sdk-0.56.0.dist-info/entry_points.txt,sha256=eV9YD0zCAb88_wNMDV99sRxVKVC-WOQF3b1Pepaytcg,385
23
- craft_ai_sdk-0.56.0.dist-info/RECORD,,
18
+ documentation.pdf,sha256=nBaepZVtiRBTCWc3IJnKVdVGU9iPLMz0jkirvyeyTTw,333557
19
+ craft_ai_sdk-0.57.0.dist-info/LICENSE,sha256=_2oYRJic9lZK05LceuJ9aZZw5mPHYc1WQhJiVS-oGFU,10754
20
+ craft_ai_sdk-0.57.0.dist-info/METADATA,sha256=xFNuWzBiSRO0DPapOOzX1iHifSC8D1kpHjxUu8QPgWo,1614
21
+ craft_ai_sdk-0.57.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
22
+ craft_ai_sdk-0.57.0.dist-info/entry_points.txt,sha256=eV9YD0zCAb88_wNMDV99sRxVKVC-WOQF3b1Pepaytcg,385
23
+ craft_ai_sdk-0.57.0.dist-info/RECORD,,
documentation.pdf CHANGED
Binary file