modal 0.74.5__py3-none-any.whl → 0.74.6__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.
@@ -33,7 +33,7 @@ from modal._partial_function import (
33
33
  _find_callables_for_obj,
34
34
  _PartialFunctionFlags,
35
35
  )
36
- from modal._serialization import deserialize_params
36
+ from modal._serialization import deserialize, deserialize_params
37
37
  from modal._utils.async_utils import TaskContext, synchronizer
38
38
  from modal._utils.function_utils import (
39
39
  callable_has_non_self_params,
@@ -394,7 +394,17 @@ def main(container_args: api_pb2.ContainerArguments, client: Client):
394
394
  with container_io_manager.heartbeats(is_snapshotting_function), UserCodeEventLoop() as event_loop:
395
395
  # If this is a serialized function, fetch the definition from the server
396
396
  if function_def.definition_type == api_pb2.Function.DEFINITION_TYPE_SERIALIZED:
397
- ser_usr_cls, ser_fun = container_io_manager.get_serialized_function()
397
+ assert function_def.function_serialized or function_def.class_serialized
398
+
399
+ if function_def.function_serialized:
400
+ ser_fun = deserialize(function_def.function_serialized, _client)
401
+ else:
402
+ ser_fun = None
403
+
404
+ if function_def.class_serialized:
405
+ ser_usr_cls = deserialize(function_def.class_serialized, _client)
406
+ else:
407
+ ser_usr_cls = None
398
408
  else:
399
409
  ser_usr_cls, ser_fun = None, None
400
410
 
@@ -450,28 +450,6 @@ class _ContainerIOManager:
450
450
 
451
451
  await asyncio.sleep(DYNAMIC_CONCURRENCY_INTERVAL_SECS)
452
452
 
453
- async def get_serialized_function(self) -> tuple[Optional[Any], Optional[Callable[..., Any]]]:
454
- # Fetch the serialized function definition
455
- request = api_pb2.FunctionGetSerializedRequest(function_id=self.function_id)
456
- response = await self._client.stub.FunctionGetSerialized(request)
457
- if response.function_serialized:
458
- fun = self.deserialize(response.function_serialized)
459
- else:
460
- fun = None
461
-
462
- if response.class_serialized:
463
- cls = self.deserialize(response.class_serialized)
464
- else:
465
- cls = None
466
-
467
- return cls, fun
468
-
469
- def serialize(self, obj: Any) -> bytes:
470
- return serialize(obj)
471
-
472
- def deserialize(self, data: bytes) -> Any:
473
- return deserialize(data, self._client)
474
-
475
453
  @synchronizer.no_io_translation
476
454
  def serialize_data_format(self, obj: Any, data_format: int) -> bytes:
477
455
  return serialize_data_format(obj, data_format)
@@ -680,20 +658,20 @@ class _ContainerIOManager:
680
658
 
681
659
  def serialize_exception(self, exc: BaseException) -> bytes:
682
660
  try:
683
- return self.serialize(exc)
661
+ return serialize(exc)
684
662
  except Exception as serialization_exc:
685
663
  # We can't always serialize exceptions.
686
664
  err = f"Failed to serialize exception {exc} of type {type(exc)}: {serialization_exc}"
687
665
  logger.info(err)
688
- return self.serialize(SerializationError(err))
666
+ return serialize(SerializationError(err))
689
667
 
690
668
  def serialize_traceback(self, exc: BaseException) -> tuple[Optional[bytes], Optional[bytes]]:
691
669
  serialized_tb, tb_line_cache = None, None
692
670
 
693
671
  try:
694
672
  tb_dict, line_cache = extract_traceback(exc, self.task_id)
695
- serialized_tb = self.serialize(tb_dict)
696
- tb_line_cache = self.serialize(line_cache)
673
+ serialized_tb = serialize(tb_dict)
674
+ tb_line_cache = serialize(line_cache)
697
675
  except Exception:
698
676
  logger.info("Failed to serialize exception traceback.")
699
677
 
@@ -100,11 +100,6 @@ class _ContainerIOManager:
100
100
  def stop_heartbeat(self): ...
101
101
  def dynamic_concurrency_manager(self) -> typing.AsyncContextManager[None]: ...
102
102
  async def _dynamic_concurrency_loop(self): ...
103
- async def get_serialized_function(
104
- self,
105
- ) -> tuple[typing.Optional[typing.Any], typing.Optional[collections.abc.Callable[..., typing.Any]]]: ...
106
- def serialize(self, obj: typing.Any) -> bytes: ...
107
- def deserialize(self, data: bytes) -> typing.Any: ...
108
103
  def serialize_data_format(self, obj: typing.Any, data_format: int) -> bytes: ...
109
104
  async def format_blob_data(self, data: bytes) -> dict[str, typing.Any]: ...
110
105
  def get_data_in(self, function_call_id: str) -> collections.abc.AsyncIterator[typing.Any]: ...
@@ -234,18 +229,6 @@ class ContainerIOManager:
234
229
 
235
230
  _dynamic_concurrency_loop: ___dynamic_concurrency_loop_spec[typing_extensions.Self]
236
231
 
237
- class __get_serialized_function_spec(typing_extensions.Protocol[SUPERSELF]):
238
- def __call__(
239
- self,
240
- ) -> tuple[typing.Optional[typing.Any], typing.Optional[collections.abc.Callable[..., typing.Any]]]: ...
241
- async def aio(
242
- self,
243
- ) -> tuple[typing.Optional[typing.Any], typing.Optional[collections.abc.Callable[..., typing.Any]]]: ...
244
-
245
- get_serialized_function: __get_serialized_function_spec[typing_extensions.Self]
246
-
247
- def serialize(self, obj: typing.Any) -> bytes: ...
248
- def deserialize(self, data: bytes) -> typing.Any: ...
249
232
  def serialize_data_format(self, obj: typing.Any, data_format: int) -> bytes: ...
250
233
 
251
234
  class __format_blob_data_spec(typing_extensions.Protocol[SUPERSELF]):
modal/client.pyi CHANGED
@@ -27,7 +27,7 @@ class _Client:
27
27
  _snapshotted: bool
28
28
 
29
29
  def __init__(
30
- self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.74.5"
30
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.74.6"
31
31
  ): ...
32
32
  def is_closed(self) -> bool: ...
33
33
  @property
@@ -85,7 +85,7 @@ class Client:
85
85
  _snapshotted: bool
86
86
 
87
87
  def __init__(
88
- self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.74.5"
88
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.74.6"
89
89
  ): ...
90
90
  def is_closed(self) -> bool: ...
91
91
  @property
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 0.74.5
3
+ Version: 0.74.6
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License: Apache-2.0
@@ -2,7 +2,7 @@ modal/__init__.py,sha256=7wz1AT_bpWJJEzXsAo3QMb7i87y7UGXwfneb0bGDhRg,2502
2
2
  modal/__main__.py,sha256=CgIjP8m1xJjjd4AXc-delmR6LdBCZclw2A_V38CFIio,2870
3
3
  modal/_clustered_functions.py,sha256=kTf-9YBXY88NutC1akI-gCbvf01RhMPCw-zoOI_YIUE,2700
4
4
  modal/_clustered_functions.pyi,sha256=vllkegc99A0jrUOWa8mdlSbdp6uz36TsHhGxysAOpaQ,771
5
- modal/_container_entrypoint.py,sha256=PVs5WDgm0_vZlECf_Ga58L49zceTMKPlUA10YRpPmy8,29026
5
+ modal/_container_entrypoint.py,sha256=DymOImhc3uGRkIq_qXmBsEbWMB4EBMpfuXzz2S4BcGg,29404
6
6
  modal/_functions.py,sha256=EoJ2IbApVoJYELjB0KvXwRV2J6jElhwGHzTbXbXef6A,74712
7
7
  modal/_ipython.py,sha256=TW1fkVOmZL3YYqdS2YlM1hqpf654Yf8ZyybHdBnlhSw,301
8
8
  modal/_location.py,sha256=joiX-0ZeutEUDTrrqLF1GHXCdVLF-rHzstocbMcd_-k,366
@@ -22,7 +22,7 @@ modal/app.py,sha256=4EeD3MXXpaeSFatuWt80xGbMH9cSYS3b9m9z3PQDlwU,48144
22
22
  modal/app.pyi,sha256=SkqXNrdnGIZ4MmNNvpGtzNLoUdyuvi9IjQQR_DRiRHk,26968
23
23
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
24
24
  modal/client.py,sha256=U-YKSw0n7J1ZLREt9cbEJCtmHe5YoPKFxl0xlkan2yc,15565
25
- modal/client.pyi,sha256=u3hvKlyHcg7urqfvFwZi7pUgTNkDbBuKJbSz3uMmqAs,7591
25
+ modal/client.pyi,sha256=pdWAlWauZyI5IxKVwSnijyh7wswJdoxxFqqemBHSEDs,7591
26
26
  modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
27
27
  modal/cloud_bucket_mount.pyi,sha256=30T3K1a89l6wzmEJ_J9iWv9SknoGqaZDx59Xs-ZQcmk,1607
28
28
  modal/cls.py,sha256=GvaNl8R5UsH7Vg88WEOyerdjvZEPK7xxi3nqHlyOW_c,33497
@@ -82,8 +82,8 @@ modal/volume.py,sha256=JAWeDvoAG95tMBv-fYIERyHsJPS_X_xGpxRRmYtb6j0,30096
82
82
  modal/volume.pyi,sha256=kTsXarphjZILXci84LQy7EyC84eXUs5-7D62IM5q3eE,12491
83
83
  modal/_runtime/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
84
84
  modal/_runtime/asgi.py,sha256=KNarxvZI9z8fnmZl2vbkWTjnoLXs9kqOahkrbsTLkyc,22429
85
- modal/_runtime/container_io_manager.py,sha256=GGej42isNXI55185J1m8gq4wbqpbcY5GKPzpznu0M3E,44648
86
- modal/_runtime/container_io_manager.pyi,sha256=wRd2wHMFru0NmNgiCBVdDTrJGkeVZsZvWwA1fzn8wi8,17009
85
+ modal/_runtime/container_io_manager.py,sha256=0yNO3HTVIM4f338rxJavD8nrRN7KhDpjz1jLux71MRY,43842
86
+ modal/_runtime/container_io_manager.pyi,sha256=3N9TOYa5hfufhJV5IiIhpvJYCeLZe-ne76-XuxcFLW0,16147
87
87
  modal/_runtime/execution_context.py,sha256=73Y5zH_o-MhVCrkJXakYVlFkKqCa2CWvqoHjOfJrJGg,3034
88
88
  modal/_runtime/execution_context.pyi,sha256=TAxQq7uLj7i9r9XbXgFZiSVBWxObFWN-rkssS0I7Vkk,661
89
89
  modal/_runtime/gpu_memory_snapshot.py,sha256=tA3m1d1cwnmHpvpCeN_WijDd6n8byn7LWlpicbIxiOI,3144
@@ -145,7 +145,7 @@ modal/requirements/2024.10.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddR
145
145
  modal/requirements/PREVIEW.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddRo,296
146
146
  modal/requirements/README.md,sha256=9tK76KP0Uph7O0M5oUgsSwEZDj5y-dcUPsnpR0Sc-Ik,854
147
147
  modal/requirements/base-images.json,sha256=57vMSqzMbLBxw5tFWSaMiIkkVEps4JfX5PAtXGnkS4U,740
148
- modal-0.74.5.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
148
+ modal-0.74.6.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
149
149
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
150
150
  modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
151
151
  modal_docs/gen_reference_docs.py,sha256=cvTgltucqYLLIX84QxAwf51Z5Vc2n6cLxS8VcrxNCAo,6401
@@ -170,9 +170,9 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
170
170
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
171
171
  modal_version/__init__.py,sha256=m94xZNWIjH8oUtJk4l9xfovzDJede2o7X-q0MHVECtM,470
172
172
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
173
- modal_version/_version_generated.py,sha256=wwyKcRGprZV5T_iYxGUBHKaewrlVo-3zW6j8jEX6Cfs,148
174
- modal-0.74.5.dist-info/METADATA,sha256=BCD7uPmo5H1GPkKhJ2KZPoVLYkMZayKy6xPrMDIX3rI,2473
175
- modal-0.74.5.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
176
- modal-0.74.5.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
177
- modal-0.74.5.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
178
- modal-0.74.5.dist-info/RECORD,,
173
+ modal_version/_version_generated.py,sha256=6eAc8YcPAZ4O3SrxUQmYc-ZMTJIY09o9f_9kCQ9b0P0,148
174
+ modal-0.74.6.dist-info/METADATA,sha256=jyd1jI7Vs2q0YnrEghXL9Z0d-YkTusYBjZhkpnIg36o,2473
175
+ modal-0.74.6.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
176
+ modal-0.74.6.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
177
+ modal-0.74.6.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
178
+ modal-0.74.6.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  # Copyright Modal Labs 2025
2
2
 
3
3
  # Note: Reset this value to -1 whenever you make a minor `0.X` release of the client.
4
- build_number = 5 # git: 2e65784
4
+ build_number = 6 # git: e51abe8
File without changes