craft-ai-sdk 0.54.0__py3-none-any.whl → 0.54.1rc1__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 +1 -1
- craft_ai_sdk/core/data_store.py +6 -4
- craft_ai_sdk/io.py +1 -1
- craft_ai_sdk/sdk.py +1 -1
- craft_ai_sdk/utils.py +18 -6
- {craft_ai_sdk-0.54.0.dist-info → craft_ai_sdk-0.54.1rc1.dist-info}/METADATA +1 -1
- {craft_ai_sdk-0.54.0.dist-info → craft_ai_sdk-0.54.1rc1.dist-info}/RECORD +11 -11
- documentation.pdf +0 -0
- {craft_ai_sdk-0.54.0.dist-info → craft_ai_sdk-0.54.1rc1.dist-info}/LICENSE +0 -0
- {craft_ai_sdk-0.54.0.dist-info → craft_ai_sdk-0.54.1rc1.dist-info}/WHEEL +0 -0
- {craft_ai_sdk-0.54.0.dist-info → craft_ai_sdk-0.54.1rc1.dist-info}/entry_points.txt +0 -0
craft_ai_sdk/__init__.py
CHANGED
craft_ai_sdk/core/data_store.py
CHANGED
|
@@ -148,7 +148,7 @@ def _upload_multipart_data_store_object(
|
|
|
148
148
|
"chunk_size": sdk._MULTIPART_PART_SIZE,
|
|
149
149
|
"part_number": part_idx,
|
|
150
150
|
}
|
|
151
|
-
if
|
|
151
|
+
if part["lastChunk"]:
|
|
152
152
|
data["size"] = (part_idx - 1) * sdk._MULTIPART_PART_SIZE + len
|
|
153
153
|
multipart_part_result = sdk._post(url=f"{multipart_base_url}/part", json=data)
|
|
154
154
|
resp = requests.put(
|
|
@@ -156,10 +156,12 @@ def _upload_multipart_data_store_object(
|
|
|
156
156
|
data=chunk,
|
|
157
157
|
headers=multipart_part_result["headers"],
|
|
158
158
|
)
|
|
159
|
-
|
|
159
|
+
partData = {"number": part_idx}
|
|
160
160
|
if "ETag" in resp.headers:
|
|
161
|
-
|
|
162
|
-
parts.append(
|
|
161
|
+
partData["metadata"] = resp.headers["ETag"]
|
|
162
|
+
parts.append(partData)
|
|
163
|
+
if part["lastChunk"]:
|
|
164
|
+
break
|
|
163
165
|
|
|
164
166
|
sdk._post(
|
|
165
167
|
url=f"{multipart_base_url}/end",
|
craft_ai_sdk/io.py
CHANGED
|
@@ -237,7 +237,7 @@ class OutputDestination:
|
|
|
237
237
|
)
|
|
238
238
|
if pipeline_output_name is None and step_output_name is None:
|
|
239
239
|
raise ValueError('missing "pipeline_output_name" argument.')
|
|
240
|
-
if
|
|
240
|
+
if step_output_name is not None:
|
|
241
241
|
warnings.warn(
|
|
242
242
|
"Providing the 'step_output_name' argument is deprecated and will "
|
|
243
243
|
"be removed in a future version. Please use the 'pipeline_output_name' keyword argument instead.", # noqa: E501
|
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.54.
|
|
133
|
+
_version = "0.54.1rc1" # Would be better to share it somewhere
|
|
134
134
|
|
|
135
135
|
def __init__(
|
|
136
136
|
self,
|
craft_ai_sdk/utils.py
CHANGED
|
@@ -278,13 +278,25 @@ def map_container_config_step_parameter(container_config):
|
|
|
278
278
|
def chunk_buffer(buffer: IOBase, size: int) -> Iterable[Union[BytesIO, StringIO]]:
|
|
279
279
|
size_int = int(size)
|
|
280
280
|
b = buffer.read(size_int)
|
|
281
|
+
next_data = None
|
|
281
282
|
while b:
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
)
|
|
287
|
-
|
|
283
|
+
chunk = StringIO() if isinstance(b, str) else BytesIO()
|
|
284
|
+
previous_data = next_data
|
|
285
|
+
if previous_data:
|
|
286
|
+
chunk.write(next_data)
|
|
287
|
+
chunk.write(b)
|
|
288
|
+
chunk.seek(0)
|
|
289
|
+
|
|
290
|
+
next_data = buffer.read(1)
|
|
291
|
+
|
|
292
|
+
data = {
|
|
293
|
+
"chunk": chunk,
|
|
294
|
+
"len": len(b) + (len(previous_data) if previous_data else 0),
|
|
295
|
+
"lastChunk": len(next_data) == 0,
|
|
296
|
+
}
|
|
297
|
+
yield data
|
|
298
|
+
chunk.close()
|
|
299
|
+
b = buffer.read(size_int - 1)
|
|
288
300
|
|
|
289
301
|
|
|
290
302
|
def convert_size(size_in_bytes):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
craft_ai_sdk/__init__.py,sha256=
|
|
1
|
+
craft_ai_sdk/__init__.py,sha256=VUCsR9DobyY5gCUkL79sK0IZCoo3Dy2c3QCG5pnGyFk,407
|
|
2
2
|
craft_ai_sdk/constants.py,sha256=5dR4JfKVz3KhBKRFSdN1nrb06kFkNiYP2mRnacsbzJA,629
|
|
3
|
-
craft_ai_sdk/core/data_store.py,sha256=
|
|
3
|
+
craft_ai_sdk/core/data_store.py,sha256=USONqCEwG_KoTv5a1fgZJmi7FIjbfo4Vi-zq82keo4E,8511
|
|
4
4
|
craft_ai_sdk/core/deployments.py,sha256=fUZBHTgOWHPShMcIvNF7XEHJLAZJwJI8zLzMtdv-Dzc,31427
|
|
5
5
|
craft_ai_sdk/core/endpoints.py,sha256=ggJ8IU0QVrGa7A0RBWiJY1Lo7Klfi9BbfGnovZD97FQ,4592
|
|
6
6
|
craft_ai_sdk/core/environment_variables.py,sha256=wy0U7y0C7tRXOXOiWGz0vX5ajHSmOb_7J1fXlSahGpI,2045
|
|
@@ -11,13 +11,13 @@ craft_ai_sdk/core/resource_metrics.py,sha256=yaco_AZ4Wu5sxLRKsA3qt2R3-PMs2e32EGO
|
|
|
11
11
|
craft_ai_sdk/core/steps.py,sha256=fodbswiMRzHBarBDUCcH1J3O8N8iKu9X66-wZ_Qfnb0,20375
|
|
12
12
|
craft_ai_sdk/core/users.py,sha256=Qi3xg7Vzk_0MepccNIZbFzjI0bBqouqkFStTuejUY6s,509
|
|
13
13
|
craft_ai_sdk/exceptions.py,sha256=IC-JfZmmmaTsbMCgirOEByRmWnatQLjKe8BErRkuwM0,1075
|
|
14
|
-
craft_ai_sdk/io.py,sha256=
|
|
15
|
-
craft_ai_sdk/sdk.py,sha256=
|
|
16
|
-
craft_ai_sdk/utils.py,sha256=
|
|
14
|
+
craft_ai_sdk/io.py,sha256=Jh9bFfXRzwCequXvJ3DKO-SIdZ7teYfzO64N940FyDY,11861
|
|
15
|
+
craft_ai_sdk/sdk.py,sha256=oGpus3zxwbYoFZZOvFSpZeOvfRCzo-xCj2glWz0Jizw,10071
|
|
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=
|
|
19
|
-
craft_ai_sdk-0.54.
|
|
20
|
-
craft_ai_sdk-0.54.
|
|
21
|
-
craft_ai_sdk-0.54.
|
|
22
|
-
craft_ai_sdk-0.54.
|
|
23
|
-
craft_ai_sdk-0.54.
|
|
18
|
+
documentation.pdf,sha256=JP3D9loXW5BklU-IpNRRUtvdxG31Y3zrERmTAtvXaZQ,334274
|
|
19
|
+
craft_ai_sdk-0.54.1rc1.dist-info/LICENSE,sha256=_2oYRJic9lZK05LceuJ9aZZw5mPHYc1WQhJiVS-oGFU,10754
|
|
20
|
+
craft_ai_sdk-0.54.1rc1.dist-info/METADATA,sha256=7PkaQVHFEMvnUOrc_f3-uMluJ6WyffT_FTzSLRpuEik,1617
|
|
21
|
+
craft_ai_sdk-0.54.1rc1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
22
|
+
craft_ai_sdk-0.54.1rc1.dist-info/entry_points.txt,sha256=eV9YD0zCAb88_wNMDV99sRxVKVC-WOQF3b1Pepaytcg,385
|
|
23
|
+
craft_ai_sdk-0.54.1rc1.dist-info/RECORD,,
|
documentation.pdf
CHANGED
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|