indexify 0.2.28__py3-none-any.whl → 0.2.29__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.
@@ -49,3 +49,11 @@ class ComputeGraphMetadata(BaseModel):
49
49
 
50
50
  def get_input_payload_serializer(self):
51
51
  return get_serializer(self.start_node.compute_fn.encoder)
52
+
53
+ def get_input_encoder(self) -> str:
54
+ if self.start_node.compute_fn:
55
+ return self.start_node.compute_fn.encoder
56
+ elif self.start_node.dynamic_router:
57
+ return self.start_node.dynamic_router.encoder
58
+
59
+ raise ValueError("start node is not set on the graph")
indexify/http_client.py CHANGED
@@ -1,6 +1,6 @@
1
1
  import json
2
2
  import os
3
- from typing import Any, Dict, List, Optional, Union
3
+ from typing import Any, Dict, List, Optional
4
4
 
5
5
  import cloudpickle
6
6
  import httpx
@@ -13,11 +13,7 @@ from indexify.error import ApiException, GraphStillProcessing
13
13
  from indexify.functions_sdk.data_objects import IndexifyData
14
14
  from indexify.functions_sdk.graph import ComputeGraphMetadata, Graph
15
15
  from indexify.functions_sdk.indexify_functions import IndexifyFunction
16
- from indexify.functions_sdk.object_serializer import (
17
- CloudPickleSerializer,
18
- JsonSerializer,
19
- get_serializer,
20
- )
16
+ from indexify.functions_sdk.object_serializer import get_serializer
21
17
  from indexify.settings import DEFAULT_SERVICE_URL
22
18
 
23
19
 
@@ -276,11 +272,10 @@ class IndexifyClient:
276
272
  self,
277
273
  graph: str,
278
274
  block_until_done: bool = False,
279
- serializer: Union[
280
- CloudPickleSerializer, JsonSerializer
281
- ] = CloudPickleSerializer,
275
+ serializer: str = "cloudpickle",
282
276
  **kwargs,
283
277
  ) -> str:
278
+ serializer = get_serializer(serializer)
284
279
  ser_input = serializer.serialize(kwargs)
285
280
  params = {"block_until_finish": block_until_done}
286
281
  kwargs = {
indexify/remote_graph.py CHANGED
@@ -1,6 +1,6 @@
1
1
  from typing import Any, List, Optional
2
2
 
3
- from indexify.functions_sdk.graph import Graph
3
+ from indexify.functions_sdk.graph import ComputeGraphMetadata, Graph
4
4
 
5
5
  from .http_client import IndexifyClient
6
6
  from .settings import DEFAULT_SERVICE_URL
@@ -30,6 +30,8 @@ class RemoteGraph:
30
30
  else:
31
31
  self._client = IndexifyClient(service_url=server_url)
32
32
 
33
+ self._graph_definition: ComputeGraphMetadata = self._client.graph(self._name)
34
+
33
35
  def run(self, block_until_done: bool = False, **kwargs) -> str:
34
36
  """
35
37
  Run the graph with the given inputs. The input is for the start function of the graph.
@@ -49,7 +51,7 @@ class RemoteGraph:
49
51
  return self._client.invoke_graph_with_object(
50
52
  self._name,
51
53
  block_until_done,
52
- self.graph.definition().get_input_payload_serializer(),
54
+ self._graph_definition.get_input_encoder(),
53
55
  **kwargs
54
56
  )
55
57
 
@@ -81,7 +83,6 @@ class RemoteGraph:
81
83
  :param client: The IndexifyClient used to communicate with the server.
82
84
  Prefered over server_url.
83
85
  """
84
- cls.graph = g
85
86
  if not client:
86
87
  client = IndexifyClient(service_url=server_url)
87
88
  client.register_compute_graph(g, additional_modules)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: indexify
3
- Version: 0.2.28
3
+ Version: 0.2.29
4
4
  Summary: Python Client for Indexify
5
5
  Home-page: https://github.com/tensorlakeai/indexify
6
6
  License: Apache 2.0
@@ -17,19 +17,19 @@ indexify/executor/task_reporter.py,sha256=Wr8caDtjHBHvK5C-wwghJ5TNxIK_moxjQokGRc
17
17
  indexify/executor/task_store.py,sha256=u48FdRKAh_KH7WOMQOArdOY5CawlyW5MJx8V0W79JM0,3951
18
18
  indexify/functions_sdk/data_objects.py,sha256=wXbUa9hjU6rsXmmk19vQ5Kixf3FsI59VBWPNmHasAX0,854
19
19
  indexify/functions_sdk/graph.py,sha256=TbHtIcAzRcEn3BWewVhNsUGMNfRduI1aSAvK6Vyx-fk,11801
20
- indexify/functions_sdk/graph_definition.py,sha256=5M2I1FaWxmDucdirnaCYR4F_-8WHPBxyNLqKl_tennk,1293
20
+ indexify/functions_sdk/graph_definition.py,sha256=5jUzjfk4gxxQCmQeOlNS9VndZK7KQBsZzABcDpQKgrs,1594
21
21
  indexify/functions_sdk/graph_validation.py,sha256=mN2Fcp91GIwFZEQP6z_qGqt4LkLM70SnI7AWBi4CmKQ,2509
22
22
  indexify/functions_sdk/image.py,sha256=QK0H6KxLWriB_z4M0kunKzzHdHxYLWL670RPYgYuf_8,1762
23
23
  indexify/functions_sdk/indexify_functions.py,sha256=EbNC5gZktRc-G9ribQrpMG2X_G-8cujsxTgot734iGQ,10340
24
24
  indexify/functions_sdk/local_cache.py,sha256=cNWF67zbhbTJe3g86hyLBy3Rqzs6dNvp2SjLazGZWvw,1348
25
25
  indexify/functions_sdk/object_serializer.py,sha256=pOgUOWbRNRix9uZT0aQn0LTCnJCeMNGO1nAE0jAybmg,1546
26
26
  indexify/functions_sdk/pipeline.py,sha256=KmxZE8eBFAQ4bbEcYURXXR26HSyoAT3O6iu9H38-OXE,974
27
- indexify/http_client.py,sha256=Gi67Z1_hGY9N-so_6YY-PobP6JparH5vWq1PDQp2SEw,15924
28
- indexify/remote_graph.py,sha256=Qzc-xOYY8upwjX92FozIyx040HRr2aeuJMUiUkK3tDk,4670
27
+ indexify/http_client.py,sha256=rFYjv0rRMo4sXp-TjWoflQeJaxNZK-Di6Gk3G78xKQI,15838
28
+ indexify/remote_graph.py,sha256=1JogFFcWCKc_Dq4Rh1s6IwAnxB-qrFnKuDQIbpJso1Y,4745
29
29
  indexify/remote_pipeline.py,sha256=oqx57rSPszNS3DToXO_nf-CKqkCZWptm1u_p3orV_gQ,790
30
30
  indexify/settings.py,sha256=Ny59mzYI4gbXoK8hjx66a_men6ndbd1J1zCTcKOoyzg,50
31
- indexify-0.2.28.dist-info/LICENSE.txt,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
32
- indexify-0.2.28.dist-info/METADATA,sha256=4L3k1UBoIMJUzmSlnPfM4yqiQbGhRG15J95HNkg-r4s,6202
33
- indexify-0.2.28.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
34
- indexify-0.2.28.dist-info/entry_points.txt,sha256=Pih7WV-XMpAzI5dEvROcpLr-ybVhd9Y-AtuzBKUdcDs,49
35
- indexify-0.2.28.dist-info/RECORD,,
31
+ indexify-0.2.29.dist-info/LICENSE.txt,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
32
+ indexify-0.2.29.dist-info/METADATA,sha256=3lC5Cqd9Uym3Bk0AvQVTT8JTlHsodWXyktGjEAU9Y7s,6202
33
+ indexify-0.2.29.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
34
+ indexify-0.2.29.dist-info/entry_points.txt,sha256=Pih7WV-XMpAzI5dEvROcpLr-ybVhd9Y-AtuzBKUdcDs,49
35
+ indexify-0.2.29.dist-info/RECORD,,