craft-ai-sdk 0.64.1rc1__py3-none-any.whl → 0.65.0rc1__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.
craft_ai_sdk/__init__.py CHANGED
@@ -13,4 +13,4 @@ from .io import ( # noqa: F401
13
13
  )
14
14
  from .sdk import CraftAiSdk # noqa: F401
15
15
 
16
- __version__ = "0.64.1rc1"
16
+ __version__ = "0.65.0rc1"
@@ -203,7 +203,7 @@ def list_pipeline_executions(sdk: BaseCraftAiSdk, pipeline_name):
203
203
  the run. In the case of an execution via a deployment, this is the user
204
204
  who created the deployment.
205
205
  * ``"end_date"`` (:obj:`str`): Date of completion of the pipeline
206
- execution.
206
+ execution. Can be `None` if the execution is still running.
207
207
  * ``"pipeline_name"`` (:obj:`str`): Name of the pipeline used for the
208
208
  execution.
209
209
  * ``"deployment_name"`` (:obj:`str`): Name of the deployment used for the
craft_ai_sdk/sdk.py CHANGED
@@ -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.64.1rc1" # Would be better to share it somewhere
142
+ _version = "0.65.0rc1" # Would be better to share it somewhere
143
143
 
144
144
  def __init__(
145
145
  self,
@@ -52,20 +52,34 @@ def convert_size(size_in_bytes: Union[int, float]):
52
52
 
53
53
  # Adapted from
54
54
  # https://gist.github.com/kazqvaizer/4cebebe5db654a414132809f9f88067b#file-multipartify-py-L13-L33
55
- def multipartify(data, parent_key=None) -> dict:
55
+ def multipartify(data, parent_key: Union[str, None] = None) -> dict:
56
+ """
57
+ Convert a nested dictionary or list into a format suitable for multipart/form-data.
58
+ This is useful for triggering endpoints that require multipart/form-data payloads.
59
+
60
+ Args:
61
+ data (:obj:`any`):
62
+ The data to convert, can be a dict, list, or a simple value.
63
+ parent_key (:obj: `str`, optional):
64
+ The key to use for the current level of the data structure.
65
+
66
+ Returns:
67
+ :obj:`dict`: A dictionary where keys are formatted for multipart/form-data.
68
+ """
69
+
56
70
  def formatter(v):
57
71
  return (None, v if v is not None else "")
58
72
 
59
- if type(data) is not dict:
73
+ if not isinstance(data, dict):
60
74
  return {parent_key: formatter(data)}
61
75
 
62
76
  converted = []
63
77
 
64
78
  for key, value in data.items():
65
79
  current_key = key if parent_key is None else f"{parent_key}[{key}]"
66
- if type(value) is dict:
80
+ if isinstance(value, dict):
67
81
  converted.extend(multipartify(value, current_key).items())
68
- elif type(value) is list:
82
+ elif isinstance(value, list):
69
83
  for ind, list_value in enumerate(value):
70
84
  iter_key = f"{current_key}[{ind}]"
71
85
  converted.extend(multipartify(list_value, iter_key).items())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: craft-ai-sdk
3
- Version: 0.64.1rc1
3
+ Version: 0.65.0rc1
4
4
  Summary: Craft AI MLOps platform SDK
5
5
  License: Apache-2.0
6
6
  Author: Craft AI
@@ -1,10 +1,10 @@
1
- craft_ai_sdk/__init__.py,sha256=y7_VQzPH1QsNyd7PbEGq5e9pj4FX0uTR_zoxkRzQTPI,366
1
+ craft_ai_sdk/__init__.py,sha256=SYFpsnIFP7_ZxErvcIabmYsYK8yKZUJ7DVo0TLDJDWA,366
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
4
  craft_ai_sdk/core/deployments.py,sha256=-XMPQJ9ZMmd3i7gEAQB7kONfScg-8JqVAD9VI1fQNEQ,37174
5
5
  craft_ai_sdk/core/endpoints.py,sha256=cB4MgEr5L0XVS_QtE1ewsFqq586NZoxqeI-ZINSS9R8,7034
6
6
  craft_ai_sdk/core/environment_variables.py,sha256=FYxwWqz8XdmxWuJLI3MP9QOObWwly3P4k6lon-KHUmU,2224
7
- craft_ai_sdk/core/pipeline_executions.py,sha256=uasCxQewvD4pYXRSPhYQnrApFVzL5covsN1tbJkxtT8,18624
7
+ craft_ai_sdk/core/pipeline_executions.py,sha256=OSol4Tk7UzALDFUCYwdHs8y5LuMz2mkEA_X9epl_FHg,18673
8
8
  craft_ai_sdk/core/pipeline_metrics.py,sha256=cyDuhQCGVRMruo-ZGGd9vfQB0rbNu8Fs1sQxnfk6Aow,7174
9
9
  craft_ai_sdk/core/pipelines.py,sha256=QrpCH9Yn6SA92xyDfF0Te-iumtkhlNRLtQAiztqcl6o,21574
10
10
  craft_ai_sdk/core/resource_metrics.py,sha256=jwxDZJIhj28rpmFJKopt_1O0X58TGjUThRpAeMvVz1Y,3455
@@ -13,7 +13,7 @@ craft_ai_sdk/core/users.py,sha256=OBwOrjE2hrqQde28ZItGxNDj52dhKY-mxabkbLaMnGQ,61
13
13
  craft_ai_sdk/core/vector_database.py,sha256=JQsz7Rj8HL9tmB8y4lSsAd3IPnuVMX2LpAK1z8yrz9M,2323
14
14
  craft_ai_sdk/exceptions.py,sha256=IC-JfZmmmaTsbMCgirOEByRmWnatQLjKe8BErRkuwM0,1075
15
15
  craft_ai_sdk/io.py,sha256=4BlUV2Rf3Y8YXMC2mRdUqbI8EzvbgkrLB-cbcrv2gco,13468
16
- craft_ai_sdk/sdk.py,sha256=1P4xg_mlEA3wKLSVUM6RQq4xpgisK50TQoSlT-LL1zE,10784
16
+ craft_ai_sdk/sdk.py,sha256=RqmZvWfN6M4PwzHjdoz_D9Ad459Uzn0zpjTxziWUGWs,10784
17
17
  craft_ai_sdk/shared/authentication.py,sha256=OdwtAH47tOUS-u_HhxlI8JdjZT5REr5B5cGSrX7sz00,885
18
18
  craft_ai_sdk/shared/environments.py,sha256=NI7DgQa4uj1PnffJUZ1Q4Car4r9OoFdXpYod26xgOIo,547
19
19
  craft_ai_sdk/shared/execution_context.py,sha256=B2Ghq-wiUvq81q5mhsm79Oc59c8c00uQxMIpApFD03o,585
@@ -25,9 +25,9 @@ craft_ai_sdk/shared/warnings.py,sha256=KElNEY5lvY3PeAPJBXUw6KIa5GrYqpewFtSzIZN0d
25
25
  craft_ai_sdk/utils/__init__.py,sha256=A0sLCXSPD1Z3q2GP1uLDjvif4ivOr__Hzg9RQysEuqo,420
26
26
  craft_ai_sdk/utils/datetime_utils.py,sha256=ziWQ2Xa_ypKIm50F_1R5OtubXSNlM4JWbFUeh7qjwpE,672
27
27
  craft_ai_sdk/utils/dict_utils.py,sha256=1HQ3A14SN48XPFDmQleujGAgksmkjIs3hyPLpwhwh24,748
28
- craft_ai_sdk/utils/file_utils.py,sha256=dKn8NzrCMc5nn0ptUL6VuUOvLo474NJFWrVBe7ccYI8,2256
29
- craft_ai_sdk-0.64.1rc1.dist-info/LICENSE,sha256=_2oYRJic9lZK05LceuJ9aZZw5mPHYc1WQhJiVS-oGFU,10754
30
- craft_ai_sdk-0.64.1rc1.dist-info/METADATA,sha256=sNMgnqJRlp9WtCbguihinPzC-PETBv6tHbF_Tk4nx3Q,1679
31
- craft_ai_sdk-0.64.1rc1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
32
- craft_ai_sdk-0.64.1rc1.dist-info/entry_points.txt,sha256=eV9YD0zCAb88_wNMDV99sRxVKVC-WOQF3b1Pepaytcg,385
33
- craft_ai_sdk-0.64.1rc1.dist-info/RECORD,,
28
+ craft_ai_sdk/utils/file_utils.py,sha256=yuOx2POHotJ3wG0h44SneZ6vcnuWtd8Khk28BRIP4O0,2805
29
+ craft_ai_sdk-0.65.0rc1.dist-info/LICENSE,sha256=_2oYRJic9lZK05LceuJ9aZZw5mPHYc1WQhJiVS-oGFU,10754
30
+ craft_ai_sdk-0.65.0rc1.dist-info/METADATA,sha256=GIQl_xQfiBitxNFQsFnIQLKwnV7L2esoF8k1c901QfI,1679
31
+ craft_ai_sdk-0.65.0rc1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
32
+ craft_ai_sdk-0.65.0rc1.dist-info/entry_points.txt,sha256=eV9YD0zCAb88_wNMDV99sRxVKVC-WOQF3b1Pepaytcg,385
33
+ craft_ai_sdk-0.65.0rc1.dist-info/RECORD,,