modal 0.75.2__py3-none-any.whl → 0.75.4__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.

Potentially problematic release.


This version of modal might be problematic. Click here for more details.

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.75.2"
30
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.75.4"
31
31
  ): ...
32
32
  def is_closed(self) -> bool: ...
33
33
  @property
@@ -86,7 +86,7 @@ class Client:
86
86
  _snapshotted: bool
87
87
 
88
88
  def __init__(
89
- self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.75.2"
89
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.75.4"
90
90
  ): ...
91
91
  def is_closed(self) -> bool: ...
92
92
  @property
modal/dict.py CHANGED
@@ -35,10 +35,12 @@ class _Dict(_Object, type_prefix="di"):
35
35
 
36
36
  **Lifetime of a Dict and its items**
37
37
 
38
- An individual dict entry will expire 30 days after it was last added to its Dict object.
39
- Additionally, data are stored in memory on the Modal server and could be lost due to
40
- unexpected server restarts. Because of this, `Dict` is best suited for storing short-term
41
- state and is not recommended for durable storage.
38
+ An individual Dict entry will expire after 7 days of inactivity (no reads or writes). The
39
+ Dict entries are written to durable storage.
40
+
41
+ Legacy Dicts (created before 2025-05-20) will still have entries expire 30 days after being
42
+ last added. Additionally, data are stored in memory on the Modal server and could be lost due to
43
+ unexpected server restarts. Eventually, these Dicts will be fully sunset.
42
44
 
43
45
  **Usage**
44
46
 
@@ -275,13 +277,18 @@ class _Dict(_Object, type_prefix="di"):
275
277
  raise exc
276
278
 
277
279
  @live_method
278
- async def put(self, key: Any, value: Any) -> None:
279
- """Add a specific key-value pair to the dictionary."""
280
+ async def put(self, key: Any, value: Any, *, skip_if_exists: bool = False) -> bool:
281
+ """Add a specific key-value pair to the dictionary.
282
+
283
+ Returns True if the key-value pair was added and False if it wasn't because the key already existed and
284
+ `skip_if_exists` was set.
285
+ """
280
286
  updates = {key: value}
281
287
  serialized = _serialize_dict(updates)
282
- req = api_pb2.DictUpdateRequest(dict_id=self.object_id, updates=serialized)
288
+ req = api_pb2.DictUpdateRequest(dict_id=self.object_id, updates=serialized, if_not_exists=skip_if_exists)
283
289
  try:
284
- await retry_transient_errors(self._client.stub.DictUpdate, req)
290
+ resp = await retry_transient_errors(self._client.stub.DictUpdate, req)
291
+ return resp.created
285
292
  except GRPCError as exc:
286
293
  if "status = '413'" in exc.message:
287
294
  raise RequestSizeError("Dict.put request is too large") from exc
modal/dict.pyi CHANGED
@@ -49,7 +49,7 @@ class _Dict(modal._object._Object):
49
49
  async def len(self) -> int: ...
50
50
  async def __getitem__(self, key: typing.Any) -> typing.Any: ...
51
51
  async def update(self, other: typing.Optional[collections.abc.Mapping] = None, /, **kwargs) -> None: ...
52
- async def put(self, key: typing.Any, value: typing.Any) -> None: ...
52
+ async def put(self, key: typing.Any, value: typing.Any, *, skip_if_exists: bool = False) -> bool: ...
53
53
  async def __setitem__(self, key: typing.Any, value: typing.Any) -> None: ...
54
54
  async def pop(self, key: typing.Any) -> typing.Any: ...
55
55
  async def __delitem__(self, key: typing.Any) -> typing.Any: ...
@@ -161,8 +161,8 @@ class Dict(modal.object.Object):
161
161
  update: __update_spec[typing_extensions.Self]
162
162
 
163
163
  class __put_spec(typing_extensions.Protocol[SUPERSELF]):
164
- def __call__(self, /, key: typing.Any, value: typing.Any) -> None: ...
165
- async def aio(self, /, key: typing.Any, value: typing.Any) -> None: ...
164
+ def __call__(self, /, key: typing.Any, value: typing.Any, *, skip_if_exists: bool = False) -> bool: ...
165
+ async def aio(self, /, key: typing.Any, value: typing.Any, *, skip_if_exists: bool = False) -> bool: ...
166
166
 
167
167
  put: __put_spec[typing_extensions.Self]
168
168
 
modal/parallel_map.py CHANGED
@@ -496,7 +496,7 @@ async def _spawn_map_async(self, *input_iterators, kwargs={}) -> None:
496
496
  errors, log a warning that the function call is waiting to be created.
497
497
  """
498
498
 
499
- return self._spawn_map_inner.aio(args, kwargs, api_pb2.FUNCTION_CALL_INVOCATION_TYPE_ASYNC)
499
+ return self._spawn_map_inner.aio(*args, **kwargs)
500
500
 
501
501
  input_gen = async_zip(*[sync_or_async_iter(it) for it in input_iterators])
502
502
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 0.75.2
3
+ Version: 0.75.4
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License: Apache-2.0
@@ -22,7 +22,7 @@ modal/app.py,sha256=xojuGZv4LaQwZU5ntj7WbmMjeNuB9Gll8Mzqe2LyiEs,51323
22
22
  modal/app.pyi,sha256=zNwR1_2LpmQc9AhemuAeVdk90XNYDw9keOkXAwAATeA,28732
23
23
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
24
24
  modal/client.py,sha256=o-aQThHpvDHUzg_kUafyhWzACViUBhY2WLZ2EitnSHA,16787
25
- modal/client.pyi,sha256=ULQxg-a5Qyp4_CHyx8LndcPKnoaTWaJOYNcRdgU_luE,8383
25
+ modal/client.pyi,sha256=iTagCtGQqBIpSTUe3_-E7RO4ouQ0ivp6zXUNj5J7MU8,8383
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=aHoMEWMZUN7bOezs3tRPxzS1FP3gTxZBORVjbPmtxyg,35338
@@ -30,8 +30,8 @@ modal/cls.pyi,sha256=klQkXHXhl5gTjRo_XDV6PGecnJeFOudSMXid_kanumI,12090
30
30
  modal/config.py,sha256=OOMEJ5LHNFbHRW5wUpuhl0TH6EPW8D1XV9I3OJXrZrk,12668
31
31
  modal/container_process.py,sha256=vvyK3DVPUMsuqvkKdUiQ49cDLF9JawGrxpglLk5vfgI,6208
32
32
  modal/container_process.pyi,sha256=cR4aRHTbcVvmxGCc1_k2Ey8JllJIAQYq9PBKx0_1TuI,2916
33
- modal/dict.py,sha256=rYOTNtUIOoIVibC1KGC6-fnsXD88ij8o0xNKFpR9BVs,14134
34
- modal/dict.pyi,sha256=ou2rospKvSNl0PffrsSABruTjspUlqwbkjJ22fzg-yE,8021
33
+ modal/dict.py,sha256=wOifmVwJS-X6FS0JcvJCfL9mrny6zWxk3EHmp-2MDpU,14481
34
+ modal/dict.pyi,sha256=RBaQyOd1ABRNN7vIf5L_rv94y7Kq5Qn9IlKHSr4j8N0,8120
35
35
  modal/environments.py,sha256=t_TdUyORfIjlEAOS7I4My1qHi0cVsjPxwKloLmAAZMc,6935
36
36
  modal/environments.pyi,sha256=4HbI0kywveaUVI7HqDtZ4HphCTGXYi_wie2hz87up5A,3425
37
37
  modal/exception.py,sha256=4JyO-SACaLNDe2QC48EjsK8GMkZ8AgEurZ8j1YdRu8E,5263
@@ -52,7 +52,7 @@ modal/network_file_system.pyi,sha256=58DiUqHGlARmI3cz-Yo7IFObKKFIiGh5UIU5JxGNFfc
52
52
  modal/object.py,sha256=bTeskuY8JFrESjU4_UL_nTwYlBQdOLmVaOX3X6EMxsg,164
53
53
  modal/object.pyi,sha256=Nc6fCW8ViC8YQPbtJav9KNDCW296-VimRUh-v3AaaYY,5674
54
54
  modal/output.py,sha256=q4T9uHduunj4NwY-YSwkHGgjZlCXMuJbfQ5UFaAGRAc,1968
55
- modal/parallel_map.py,sha256=ZOzjgCBcXv4gyOmEsLPVRkji1r2yqPIsP4Diw7G0hWI,35694
55
+ modal/parallel_map.py,sha256=05ynu1N4v8tySedL1wd07de0Fpp7BD0rRzakhNd07Wg,35652
56
56
  modal/parallel_map.pyi,sha256=kwggW2Vqnarlr8yk7e7H-8KsLB2GEBUs4OrRz_tUBa0,5883
57
57
  modal/partial_function.py,sha256=SwuAAj2wj4SO6F6nkSnwNZrczEmm9w9YdlQTHh6hr04,1195
58
58
  modal/partial_function.pyi,sha256=NFWz1aCAs2B3-GnPf1cTatWRZOLnYpFKCnjP_X9iNRs,6411
@@ -146,7 +146,7 @@ modal/requirements/2024.10.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddR
146
146
  modal/requirements/PREVIEW.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddRo,296
147
147
  modal/requirements/README.md,sha256=9tK76KP0Uph7O0M5oUgsSwEZDj5y-dcUPsnpR0Sc-Ik,854
148
148
  modal/requirements/base-images.json,sha256=57vMSqzMbLBxw5tFWSaMiIkkVEps4JfX5PAtXGnkS4U,740
149
- modal-0.75.2.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
149
+ modal-0.75.4.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
150
150
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
151
151
  modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
152
152
  modal_docs/gen_reference_docs.py,sha256=d_CQUGQ0rfw28u75I2mov9AlS773z9rG40-yq5o7g2U,6359
@@ -171,9 +171,9 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
171
171
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
172
172
  modal_version/__init__.py,sha256=PenIvZdwt-HVdbetAyxuPoyZTtzx2moKZoJLK8iZ804,470
173
173
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
174
- modal_version/_version_generated.py,sha256=pZ5dfwYywLBy6TOiAJ3SE-v63njBMLpa4n8Y_rtF2oo,148
175
- modal-0.75.2.dist-info/METADATA,sha256=uQ8Aiaf12lorzDtPL7aA9nEd9kkl_ZAkc4-rVVw9eW0,2450
176
- modal-0.75.2.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
177
- modal-0.75.2.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
178
- modal-0.75.2.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
179
- modal-0.75.2.dist-info/RECORD,,
174
+ modal_version/_version_generated.py,sha256=cQpRHpoB92GmrxJfV3_xS45YgpwKaYZzwmiTgDnK0oQ,148
175
+ modal-0.75.4.dist-info/METADATA,sha256=0lf-ZguZsIPkx1KLjg5C2rP6HMt34-RbZveYU3W0eZI,2450
176
+ modal-0.75.4.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
177
+ modal-0.75.4.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
178
+ modal-0.75.4.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
179
+ modal-0.75.4.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 = 2 # git: 8085190
4
+ build_number = 4 # git: 344590c
File without changes