indexify 0.2.15__py3-none-any.whl → 0.2.16__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.
@@ -1,11 +1,20 @@
1
+ def python_version_to_image(python_version):
2
+ if python_version.startswith("3.9"):
3
+ return "python:3.9.20-bookworm"
4
+ elif python_version.startswith("3.10"):
5
+ return "python:3.10.15-bookworm"
6
+ elif python_version.startswith("3.11"):
7
+ return "python:3.11.10-bookworm"
8
+ else:
9
+ raise ValueError(f"unsupported Python version: {python_version}")
10
+
11
+
1
12
  class Image:
2
- def __init__(self):
13
+ def __init__(self, python="3.10"):
3
14
  self._image_name = None
4
-
5
15
  self._tag = "latest"
6
-
7
- self._base_image = "python:3.11.10-slim-bookworm"
8
-
16
+ self._base_image = python_version_to_image(python)
17
+ self._python_version = python
9
18
  self._run_strs = []
10
19
 
11
20
  def name(self, image_name):
@@ -218,6 +218,8 @@ class IndexifyFunctionWrapper:
218
218
  args.append(input)
219
219
 
220
220
  extracted_data = self.indexify_function.run(*args, **kwargs)
221
+ if extracted_data is None:
222
+ return []
221
223
 
222
224
  return extracted_data if isinstance(extracted_data, list) else [extracted_data]
223
225
 
@@ -234,7 +236,7 @@ class IndexifyFunctionWrapper:
234
236
  acc = self.indexify_function.accumulate.model_validate(
235
237
  self.indexify_function.accumulate()
236
238
  )
237
- outputs: List[Any] = self.run_fn(input, acc=acc)
239
+ outputs: Optional[List[Any]] = self.run_fn(input, acc=acc)
238
240
  return [
239
241
  IndexifyData(payload=serializer.serialize(output)) for output in outputs
240
242
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: indexify
3
- Version: 0.2.15
3
+ Version: 0.2.16
4
4
  Summary: Python Client for Indexify
5
5
  Home-page: https://github.com/tensorlakeai/indexify
6
6
  License: Apache 2.0
@@ -17,8 +17,8 @@ indexify/functions_sdk/data_objects.py,sha256=CQZMzYiV7l6dyzFkYquWQHqdte6JnC7XA3
17
17
  indexify/functions_sdk/graph.py,sha256=3hUZjdCesiAHJ9y1_heQsEFO-WHROR4kRYxBtVnb7Y4,11937
18
18
  indexify/functions_sdk/graph_definition.py,sha256=EJfC0MdKEbFF1CBaU0htrveSlcAQJCH96DLSNfZ02V4,1178
19
19
  indexify/functions_sdk/graph_validation.py,sha256=XLHiC9PAtZungJLysU3hIUOPNDkO5TXUDZ_jiZ0H4hg,2508
20
- indexify/functions_sdk/image.py,sha256=Rsol3LfE15Kca78ruPfDrDPqCkeZPxZx0ULYrFFS5ig,905
21
- indexify/functions_sdk/indexify_functions.py,sha256=KTEbTs-waqXTKC5e2f1MWxShr87nwJd3PgNEL3QMvIU,9593
20
+ indexify/functions_sdk/image.py,sha256=0uM2VQXqB45ymnFyZVJIiyTGUYHWAHDZ1ORu-hWrofk,1338
21
+ indexify/functions_sdk/indexify_functions.py,sha256=2KZRKdyLSzsrVrWfJGQp_b8grffDKSt_ripgiISTz8Q,9660
22
22
  indexify/functions_sdk/local_cache.py,sha256=cNWF67zbhbTJe3g86hyLBy3Rqzs6dNvp2SjLazGZWvw,1348
23
23
  indexify/functions_sdk/object_serializer.py,sha256=Zz4GobW3ZamBBtFDF76QxU3TP6oJNdWnhsfKd0OUFoc,1660
24
24
  indexify/functions_sdk/pipeline.py,sha256=7hDatRK-SCHYvttf2Vj5YFyiJEVU0OOXEZBOIQenSmk,847
@@ -26,8 +26,8 @@ indexify/http_client.py,sha256=x92EbFD987pIxuBVVQZ-eN9nSL-oI2vpfv6OSKuBGgs,13589
26
26
  indexify/remote_graph.py,sha256=ILg6IY6EFgyvnfz1DSzicBZhqvPkg2-UUwgI6lxp6sA,3094
27
27
  indexify/remote_pipeline.py,sha256=FW7IAv3r24OOpiqlprw3kuFrpdkqi6Ic4_tT26FThjA,761
28
28
  indexify/settings.py,sha256=LSaWZ0ADIVmUv6o6dHWRC3-Ry5uLbCw2sBSg1e_U7UM,99
29
- indexify-0.2.15.dist-info/LICENSE.txt,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
30
- indexify-0.2.15.dist-info/METADATA,sha256=6iDb6m_2f2tjoA9y4630Z6j23ymDLGmoNjkIIyV1kxA,6199
31
- indexify-0.2.15.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
32
- indexify-0.2.15.dist-info/entry_points.txt,sha256=Pih7WV-XMpAzI5dEvROcpLr-ybVhd9Y-AtuzBKUdcDs,49
33
- indexify-0.2.15.dist-info/RECORD,,
29
+ indexify-0.2.16.dist-info/LICENSE.txt,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
30
+ indexify-0.2.16.dist-info/METADATA,sha256=kvomzkLgJZoVQYfukNvExhEMmzwJBMwOBTq6oPnEy9A,6199
31
+ indexify-0.2.16.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
32
+ indexify-0.2.16.dist-info/entry_points.txt,sha256=Pih7WV-XMpAzI5dEvROcpLr-ybVhd9Y-AtuzBKUdcDs,49
33
+ indexify-0.2.16.dist-info/RECORD,,