modal 1.1.2.dev14__py3-none-any.whl → 1.1.2.dev16__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.
modal/cli/dict.py CHANGED
@@ -63,17 +63,21 @@ async def clear(name: str, *, yes: bool = YES_OPTION, env: Optional[str] = ENV_O
63
63
 
64
64
  @dict_cli.command(name="delete", rich_help_panel="Management")
65
65
  @synchronizer.create_blocking
66
- async def delete(name: str, *, yes: bool = YES_OPTION, env: Optional[str] = ENV_OPTION):
66
+ async def delete(
67
+ name: str,
68
+ *,
69
+ allow_missing: bool = Option(False, "--allow-missing", help="Don't error if the Dict doesn't exist."),
70
+ yes: bool = YES_OPTION,
71
+ env: Optional[str] = ENV_OPTION,
72
+ ):
67
73
  """Delete a named Dict and all of its data."""
68
- # Lookup first to validate the name, even though delete is a staticmethod
69
- await _Dict.from_name(name, environment_name=env).hydrate()
70
74
  if not yes:
71
75
  typer.confirm(
72
76
  f"Are you sure you want to irrevocably delete the modal.Dict '{name}'?",
73
77
  default=False,
74
78
  abort=True,
75
79
  )
76
- await _Dict.delete(name, environment_name=env)
80
+ await _Dict.objects.delete(name, environment_name=env, allow_missing=allow_missing)
77
81
 
78
82
 
79
83
  @dict_cli.command(name="get", rich_help_panel="Inspection")
modal/cli/queues.py CHANGED
@@ -45,17 +45,22 @@ async def create(name: str, *, env: Optional[str] = ENV_OPTION):
45
45
 
46
46
  @queue_cli.command(name="delete", rich_help_panel="Management")
47
47
  @synchronizer.create_blocking
48
- async def delete(name: str, *, yes: bool = YES_OPTION, env: Optional[str] = ENV_OPTION):
48
+ async def delete(
49
+ name: str,
50
+ *,
51
+ allow_missing: bool = Option(False, "--allow-missing", help="Don't error if the Queue doesn't exist."),
52
+ yes: bool = YES_OPTION,
53
+ env: Optional[str] = ENV_OPTION,
54
+ ):
49
55
  """Delete a named Queue and all of its data."""
50
- # Lookup first to validate the name, even though delete is a staticmethod
51
- await _Queue.from_name(name, environment_name=env).hydrate()
56
+ env = ensure_env(env)
52
57
  if not yes:
53
58
  typer.confirm(
54
59
  f"Are you sure you want to irrevocably delete the modal.Queue '{name}'?",
55
60
  default=False,
56
61
  abort=True,
57
62
  )
58
- await _Queue.delete(name, environment_name=env)
63
+ await _Queue.objects.delete(name, environment_name=env, allow_missing=allow_missing)
59
64
 
60
65
 
61
66
  @queue_cli.command(name="list", rich_help_panel="Management")
modal/cli/secret.py CHANGED
@@ -11,7 +11,7 @@ from typing import Optional
11
11
  import click
12
12
  import typer
13
13
  from rich.syntax import Syntax
14
- from typer import Argument
14
+ from typer import Argument, Option
15
15
 
16
16
  from modal._output import make_console
17
17
  from modal._utils.async_utils import synchronizer
@@ -158,26 +158,23 @@ def some_function():
158
158
  console.print(Syntax(example_code, "python"))
159
159
 
160
160
 
161
- @secret_cli.command("delete", help="Delete a named secret.")
161
+ @secret_cli.command("delete", help="Delete a named Secret.")
162
162
  @synchronizer.create_blocking
163
163
  async def delete(
164
- secret_name: str = Argument(help="Name of the modal.Secret to be deleted. Case sensitive"),
164
+ name: str = Argument(help="Name of the modal.Secret to be deleted. Case sensitive"),
165
+ *,
166
+ allow_missing: bool = Option(False, "--allow-missing", help="Don't error if the Secret doesn't exist."),
165
167
  yes: bool = YES_OPTION,
166
168
  env: Optional[str] = ENV_OPTION,
167
169
  ):
168
- """TODO"""
169
170
  env = ensure_env(env)
170
- secret = await _Secret.from_name(secret_name, environment_name=env).hydrate()
171
171
  if not yes:
172
172
  typer.confirm(
173
- f"Are you sure you want to irrevocably delete the modal.Secret '{secret_name}'?",
173
+ f"Are you sure you want to irrevocably delete the modal.Secret '{name}'?",
174
174
  default=False,
175
175
  abort=True,
176
176
  )
177
- client = await _Client.from_env()
178
-
179
- # TODO: replace with API on `modal.Secret` when we add it
180
- await client.stub.SecretDelete(api_pb2.SecretDeleteRequest(secret_id=secret.object_id))
177
+ await _Secret.objects.delete(name, environment_name=env, allow_missing=allow_missing)
181
178
 
182
179
 
183
180
  def get_text_from_editor(key) -> str:
modal/cli/volume.py CHANGED
@@ -274,25 +274,26 @@ async def cp(
274
274
 
275
275
  @volume_cli.command(
276
276
  name="delete",
277
- help="Delete a named, persistent modal.Volume.",
277
+ help="Delete a named Volume and all of its data.",
278
278
  rich_help_panel="Management",
279
279
  )
280
280
  @synchronizer.create_blocking
281
281
  async def delete(
282
- volume_name: str = Argument(help="Name of the modal.Volume to be deleted. Case sensitive"),
282
+ name: str = Argument(help="Name of the modal.Volume to be deleted. Case sensitive"),
283
+ *,
284
+ allow_missing: bool = Option(False, "--allow-missing", help="Don't error if the Volume doesn't exist."),
283
285
  yes: bool = YES_OPTION,
284
286
  env: Optional[str] = ENV_OPTION,
285
287
  ):
286
- # Lookup first to validate the name, even though delete is a staticmethod
287
- await _Volume.from_name(volume_name, environment_name=env).hydrate()
288
+ env = ensure_env(env)
288
289
  if not yes:
289
290
  typer.confirm(
290
- f"Are you sure you want to irrevocably delete the modal.Volume '{volume_name}'?",
291
+ f"Are you sure you want to irrevocably delete the modal.Volume '{name}'?",
291
292
  default=False,
292
293
  abort=True,
293
294
  )
294
295
 
295
- await _Volume.delete(volume_name, environment_name=env)
296
+ await _Volume.objects.delete(name, environment_name=env, allow_missing=allow_missing)
296
297
 
297
298
 
298
299
  @volume_cli.command(
modal/client.pyi CHANGED
@@ -33,7 +33,7 @@ class _Client:
33
33
  server_url: str,
34
34
  client_type: int,
35
35
  credentials: typing.Optional[tuple[str, str]],
36
- version: str = "1.1.2.dev14",
36
+ version: str = "1.1.2.dev16",
37
37
  ):
38
38
  """mdmd:hidden
39
39
  The Modal client object is not intended to be instantiated directly by users.
@@ -164,7 +164,7 @@ class Client:
164
164
  server_url: str,
165
165
  client_type: int,
166
166
  credentials: typing.Optional[tuple[str, str]],
167
- version: str = "1.1.2.dev14",
167
+ version: str = "1.1.2.dev16",
168
168
  ):
169
169
  """mdmd:hidden
170
170
  The Modal client object is not intended to be instantiated directly by users.
modal/dict.py CHANGED
@@ -27,7 +27,7 @@ from ._utils.name_utils import check_object_name
27
27
  from ._utils.time_utils import as_timestamp, timestamp_to_localized_dt
28
28
  from .client import _Client
29
29
  from .config import logger
30
- from .exception import InvalidError, RequestSizeError
30
+ from .exception import InvalidError, NotFoundError, RequestSizeError
31
31
 
32
32
 
33
33
  def _serialize_dict(data):
@@ -104,6 +104,40 @@ class _DictManager:
104
104
  dicts = [_Dict._new_hydrated(item.dict_id, client, item.metadata, is_another_app=True) for item in items]
105
105
  return dicts[:max_objects] if max_objects is not None else dicts
106
106
 
107
+ @staticmethod
108
+ async def delete(
109
+ name: str, # Name of the Dict to delete
110
+ *,
111
+ allow_missing: bool = False, # If True, don't raise an error if the Dict doesn't exist
112
+ environment_name: Optional[str] = None, # Uses active environment if not specified
113
+ client: Optional[_Client] = None, # Optional client with Modal credentials
114
+ ):
115
+ """Delete a named Dict.
116
+
117
+ Warning: This deletes an *entire Dict*, not just a specific key.
118
+ Deletion is irreversible and will affect any Apps currently using the Dict.
119
+
120
+ **Examples:**
121
+
122
+ ```python notest
123
+ await modal.Dict.objects.delete("my-dict")
124
+ ```
125
+
126
+ Dicts will be deleted from the active environment, or another one can be specified:
127
+
128
+ ```python notest
129
+ await modal.Dict.objects.delete("my-dict", environment_name="dev")
130
+ ```
131
+ """
132
+ try:
133
+ obj = await _Dict.from_name(name, environment_name=environment_name).hydrate(client)
134
+ except NotFoundError:
135
+ if not allow_missing:
136
+ raise
137
+ else:
138
+ req = api_pb2.DictDeleteRequest(dict_id=obj.object_id)
139
+ await retry_transient_errors(obj._client.stub.DictDelete, req)
140
+
107
141
 
108
142
  DictManager = synchronize_api(_DictManager)
109
143
 
@@ -311,9 +345,18 @@ class _Dict(_Object, type_prefix="di"):
311
345
  client: Optional[_Client] = None,
312
346
  environment_name: Optional[str] = None,
313
347
  ):
314
- obj = await _Dict.from_name(name, environment_name=environment_name).hydrate(client)
315
- req = api_pb2.DictDeleteRequest(dict_id=obj.object_id)
316
- await retry_transient_errors(obj._client.stub.DictDelete, req)
348
+ """mdmd:hidden
349
+ Delete a named Dict object.
350
+
351
+ Warning: This deletes an *entire Dict*, not just a specific key.
352
+ Deletion is irreversible and will affect any Apps currently using the Dict.
353
+
354
+ DEPRECATED: This method is deprecated; we recommend using `modal.Dict.objects.delete` instead.
355
+ """
356
+ deprecation_warning(
357
+ (2025, 8, 6), "`modal.Dict.delete` is deprecated; we recommend using `modal.Dict.objects.delete` instead."
358
+ )
359
+ await _Dict.objects.delete(name, environment_name=environment_name, client=client)
317
360
 
318
361
  @live_method
319
362
  async def info(self) -> DictInfo:
modal/dict.pyi CHANGED
@@ -67,6 +67,33 @@ class _DictManager:
67
67
  """
68
68
  ...
69
69
 
70
+ @staticmethod
71
+ async def delete(
72
+ name: str,
73
+ *,
74
+ allow_missing: bool = False,
75
+ environment_name: typing.Optional[str] = None,
76
+ client: typing.Optional[modal.client._Client] = None,
77
+ ):
78
+ """Delete a named Dict.
79
+
80
+ Warning: This deletes an *entire Dict*, not just a specific key.
81
+ Deletion is irreversible and will affect any Apps currently using the Dict.
82
+
83
+ **Examples:**
84
+
85
+ ```python notest
86
+ await modal.Dict.objects.delete("my-dict")
87
+ ```
88
+
89
+ Dicts will be deleted from the active environment, or another one can be specified:
90
+
91
+ ```python notest
92
+ await modal.Dict.objects.delete("my-dict", environment_name="dev")
93
+ ```
94
+ """
95
+ ...
96
+
70
97
  class DictManager:
71
98
  """Namespace with methods for managing named Dict objects."""
72
99
  def __init__(self, /, *args, **kwargs):
@@ -142,6 +169,65 @@ class DictManager:
142
169
 
143
170
  list: __list_spec
144
171
 
172
+ class __delete_spec(typing_extensions.Protocol):
173
+ def __call__(
174
+ self,
175
+ /,
176
+ name: str,
177
+ *,
178
+ allow_missing: bool = False,
179
+ environment_name: typing.Optional[str] = None,
180
+ client: typing.Optional[modal.client.Client] = None,
181
+ ):
182
+ """Delete a named Dict.
183
+
184
+ Warning: This deletes an *entire Dict*, not just a specific key.
185
+ Deletion is irreversible and will affect any Apps currently using the Dict.
186
+
187
+ **Examples:**
188
+
189
+ ```python notest
190
+ await modal.Dict.objects.delete("my-dict")
191
+ ```
192
+
193
+ Dicts will be deleted from the active environment, or another one can be specified:
194
+
195
+ ```python notest
196
+ await modal.Dict.objects.delete("my-dict", environment_name="dev")
197
+ ```
198
+ """
199
+ ...
200
+
201
+ async def aio(
202
+ self,
203
+ /,
204
+ name: str,
205
+ *,
206
+ allow_missing: bool = False,
207
+ environment_name: typing.Optional[str] = None,
208
+ client: typing.Optional[modal.client.Client] = None,
209
+ ):
210
+ """Delete a named Dict.
211
+
212
+ Warning: This deletes an *entire Dict*, not just a specific key.
213
+ Deletion is irreversible and will affect any Apps currently using the Dict.
214
+
215
+ **Examples:**
216
+
217
+ ```python notest
218
+ await modal.Dict.objects.delete("my-dict")
219
+ ```
220
+
221
+ Dicts will be deleted from the active environment, or another one can be specified:
222
+
223
+ ```python notest
224
+ await modal.Dict.objects.delete("my-dict", environment_name="dev")
225
+ ```
226
+ """
227
+ ...
228
+
229
+ delete: __delete_spec
230
+
145
231
  class _Dict(modal._object._Object):
146
232
  """Distributed dictionary for storage in Modal apps.
147
233
 
@@ -274,7 +360,17 @@ class _Dict(modal._object._Object):
274
360
  *,
275
361
  client: typing.Optional[modal.client._Client] = None,
276
362
  environment_name: typing.Optional[str] = None,
277
- ): ...
363
+ ):
364
+ """mdmd:hidden
365
+ Delete a named Dict object.
366
+
367
+ Warning: This deletes an *entire Dict*, not just a specific key.
368
+ Deletion is irreversible and will affect any Apps currently using the Dict.
369
+
370
+ DEPRECATED: This method is deprecated; we recommend using `modal.Dict.objects.delete` instead.
371
+ """
372
+ ...
373
+
278
374
  async def info(self) -> DictInfo:
279
375
  """Return information about the Dict object."""
280
376
  ...
@@ -534,7 +630,17 @@ class Dict(modal.object.Object):
534
630
  *,
535
631
  client: typing.Optional[modal.client.Client] = None,
536
632
  environment_name: typing.Optional[str] = None,
537
- ): ...
633
+ ):
634
+ """mdmd:hidden
635
+ Delete a named Dict object.
636
+
637
+ Warning: This deletes an *entire Dict*, not just a specific key.
638
+ Deletion is irreversible and will affect any Apps currently using the Dict.
639
+
640
+ DEPRECATED: This method is deprecated; we recommend using `modal.Dict.objects.delete` instead.
641
+ """
642
+ ...
643
+
538
644
  async def aio(
539
645
  self,
540
646
  /,
@@ -542,7 +648,16 @@ class Dict(modal.object.Object):
542
648
  *,
543
649
  client: typing.Optional[modal.client.Client] = None,
544
650
  environment_name: typing.Optional[str] = None,
545
- ): ...
651
+ ):
652
+ """mdmd:hidden
653
+ Delete a named Dict object.
654
+
655
+ Warning: This deletes an *entire Dict*, not just a specific key.
656
+ Deletion is irreversible and will affect any Apps currently using the Dict.
657
+
658
+ DEPRECATED: This method is deprecated; we recommend using `modal.Dict.objects.delete` instead.
659
+ """
660
+ ...
546
661
 
547
662
  delete: __delete_spec
548
663
 
modal/functions.pyi CHANGED
@@ -433,7 +433,7 @@ class Function(
433
433
 
434
434
  _call_generator: ___call_generator_spec[typing_extensions.Self]
435
435
 
436
- class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
436
+ class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
437
437
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER:
438
438
  """Calls the function remotely, executing it with the given arguments and returning the execution's result."""
439
439
  ...
@@ -442,7 +442,7 @@ class Function(
442
442
  """Calls the function remotely, executing it with the given arguments and returning the execution's result."""
443
443
  ...
444
444
 
445
- remote: __remote_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
445
+ remote: __remote_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
446
446
 
447
447
  class __remote_gen_spec(typing_extensions.Protocol[SUPERSELF]):
448
448
  def __call__(self, /, *args, **kwargs) -> typing.Generator[typing.Any, None, None]:
@@ -469,7 +469,7 @@ class Function(
469
469
  """
470
470
  ...
471
471
 
472
- class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
472
+ class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
473
473
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
474
474
  """[Experimental] Calls the function with the given arguments, without waiting for the results.
475
475
 
@@ -493,7 +493,7 @@ class Function(
493
493
  ...
494
494
 
495
495
  _experimental_spawn: ___experimental_spawn_spec[
496
- modal._functions.P, modal._functions.ReturnType, typing_extensions.Self
496
+ modal._functions.ReturnType, modal._functions.P, typing_extensions.Self
497
497
  ]
498
498
 
499
499
  class ___spawn_map_inner_spec(typing_extensions.Protocol[P_INNER, SUPERSELF]):
@@ -502,7 +502,7 @@ class Function(
502
502
 
503
503
  _spawn_map_inner: ___spawn_map_inner_spec[modal._functions.P, typing_extensions.Self]
504
504
 
505
- class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
505
+ class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
506
506
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
507
507
  """Calls the function with the given arguments, without waiting for the results.
508
508
 
@@ -523,7 +523,7 @@ class Function(
523
523
  """
524
524
  ...
525
525
 
526
- spawn: __spawn_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
526
+ spawn: __spawn_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
527
527
 
528
528
  def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]:
529
529
  """Return the inner Python object wrapped by this Modal Function."""
modal/queue.py CHANGED
@@ -29,7 +29,7 @@ from ._utils.grpc_utils import retry_transient_errors
29
29
  from ._utils.name_utils import check_object_name
30
30
  from ._utils.time_utils import as_timestamp, timestamp_to_localized_dt
31
31
  from .client import _Client
32
- from .exception import InvalidError, RequestSizeError
32
+ from .exception import InvalidError, NotFoundError, RequestSizeError
33
33
 
34
34
 
35
35
  @dataclass
@@ -102,6 +102,40 @@ class _QueueManager:
102
102
  queues = [_Queue._new_hydrated(item.queue_id, client, item.metadata, is_another_app=True) for item in items]
103
103
  return queues[:max_objects] if max_objects is not None else queues
104
104
 
105
+ @staticmethod
106
+ async def delete(
107
+ name: str, # Name of the Queue to delete
108
+ *,
109
+ allow_missing: bool = False, # If True, don't raise an error if the Queue doesn't exist
110
+ environment_name: Optional[str] = None, # Uses active environment if not specified
111
+ client: Optional[_Client] = None, # Optional client with Modal credentials
112
+ ):
113
+ """Delete a named Queue.
114
+
115
+ Warning: This deletes an *entire Queue*, not just a specific entry or partition.
116
+ Deletion is irreversible and will affect any Apps currently using the Queue.
117
+
118
+ **Examples:**
119
+
120
+ ```python notest
121
+ await modal.Queue.objects.delete("my-queue")
122
+ ```
123
+
124
+ Queues will be deleted from the active environment, or another one can be specified:
125
+
126
+ ```python notest
127
+ await modal.Queue.objects.delete("my-queue", environment_name="dev")
128
+ ```
129
+ """
130
+ try:
131
+ obj = await _Queue.from_name(name, environment_name=environment_name).hydrate(client)
132
+ except NotFoundError:
133
+ if not allow_missing:
134
+ raise
135
+ else:
136
+ req = api_pb2.QueueDeleteRequest(queue_id=obj.object_id)
137
+ await retry_transient_errors(obj._client.stub.QueueDelete, req)
138
+
105
139
 
106
140
  QueueManager = synchronize_api(_QueueManager)
107
141
 
@@ -323,9 +357,20 @@ class _Queue(_Object, type_prefix="qu"):
323
357
 
324
358
  @staticmethod
325
359
  async def delete(name: str, *, client: Optional[_Client] = None, environment_name: Optional[str] = None):
326
- obj = await _Queue.from_name(name, environment_name=environment_name).hydrate(client)
327
- req = api_pb2.QueueDeleteRequest(queue_id=obj.object_id)
328
- await retry_transient_errors(obj._client.stub.QueueDelete, req)
360
+ """mdmd:hidden
361
+ Delete a named Queue.
362
+
363
+ Warning: This deletes an *entire Queue*, not just a specific entry or partition.
364
+ Deletion is irreversible and will affect any Apps currently using the Queue.
365
+
366
+ DEPRECATED: This method is deprecated; we recommend using `modal.Queue.objects.delete` instead.
367
+
368
+ """
369
+ deprecation_warning(
370
+ (2025, 8, 6),
371
+ "`modal.Queue.delete` is deprecated; we recommend using `modal.Queue.objects.delete` instead.",
372
+ )
373
+ await _Queue.objects.delete(name, environment_name=environment_name, client=client)
329
374
 
330
375
  @live_method
331
376
  async def info(self) -> QueueInfo:
modal/queue.pyi CHANGED
@@ -65,6 +65,33 @@ class _QueueManager:
65
65
  """
66
66
  ...
67
67
 
68
+ @staticmethod
69
+ async def delete(
70
+ name: str,
71
+ *,
72
+ allow_missing: bool = False,
73
+ environment_name: typing.Optional[str] = None,
74
+ client: typing.Optional[modal.client._Client] = None,
75
+ ):
76
+ """Delete a named Queue.
77
+
78
+ Warning: This deletes an *entire Queue*, not just a specific entry or partition.
79
+ Deletion is irreversible and will affect any Apps currently using the Queue.
80
+
81
+ **Examples:**
82
+
83
+ ```python notest
84
+ await modal.Queue.objects.delete("my-queue")
85
+ ```
86
+
87
+ Queues will be deleted from the active environment, or another one can be specified:
88
+
89
+ ```python notest
90
+ await modal.Queue.objects.delete("my-queue", environment_name="dev")
91
+ ```
92
+ """
93
+ ...
94
+
68
95
  class QueueManager:
69
96
  """Namespace with methods for managing named Queue objects."""
70
97
  def __init__(self, /, *args, **kwargs):
@@ -140,6 +167,65 @@ class QueueManager:
140
167
 
141
168
  list: __list_spec
142
169
 
170
+ class __delete_spec(typing_extensions.Protocol):
171
+ def __call__(
172
+ self,
173
+ /,
174
+ name: str,
175
+ *,
176
+ allow_missing: bool = False,
177
+ environment_name: typing.Optional[str] = None,
178
+ client: typing.Optional[modal.client.Client] = None,
179
+ ):
180
+ """Delete a named Queue.
181
+
182
+ Warning: This deletes an *entire Queue*, not just a specific entry or partition.
183
+ Deletion is irreversible and will affect any Apps currently using the Queue.
184
+
185
+ **Examples:**
186
+
187
+ ```python notest
188
+ await modal.Queue.objects.delete("my-queue")
189
+ ```
190
+
191
+ Queues will be deleted from the active environment, or another one can be specified:
192
+
193
+ ```python notest
194
+ await modal.Queue.objects.delete("my-queue", environment_name="dev")
195
+ ```
196
+ """
197
+ ...
198
+
199
+ async def aio(
200
+ self,
201
+ /,
202
+ name: str,
203
+ *,
204
+ allow_missing: bool = False,
205
+ environment_name: typing.Optional[str] = None,
206
+ client: typing.Optional[modal.client.Client] = None,
207
+ ):
208
+ """Delete a named Queue.
209
+
210
+ Warning: This deletes an *entire Queue*, not just a specific entry or partition.
211
+ Deletion is irreversible and will affect any Apps currently using the Queue.
212
+
213
+ **Examples:**
214
+
215
+ ```python notest
216
+ await modal.Queue.objects.delete("my-queue")
217
+ ```
218
+
219
+ Queues will be deleted from the active environment, or another one can be specified:
220
+
221
+ ```python notest
222
+ await modal.Queue.objects.delete("my-queue", environment_name="dev")
223
+ ```
224
+ """
225
+ ...
226
+
227
+ delete: __delete_spec
228
+
143
229
  class _Queue(modal._object._Object):
144
230
  """Distributed, FIFO queue for data flow in Modal apps.
145
231
 
@@ -297,7 +383,17 @@ class _Queue(modal._object._Object):
297
383
  *,
298
384
  client: typing.Optional[modal.client._Client] = None,
299
385
  environment_name: typing.Optional[str] = None,
300
- ): ...
386
+ ):
387
+ """mdmd:hidden
388
+ Delete a named Queue.
389
+
390
+ Warning: This deletes an *entire Queue*, not just a specific entry or partition.
391
+ Deletion is irreversible and will affect any Apps currently using the Queue.
392
+
393
+ DEPRECATED: This method is deprecated; we recommend using `modal.Queue.objects.delete` instead.
394
+ """
395
+ ...
396
+
301
397
  async def info(self) -> QueueInfo:
302
398
  """Return information about the Queue object."""
303
399
  ...
@@ -597,7 +693,17 @@ class Queue(modal.object.Object):
597
693
  *,
598
694
  client: typing.Optional[modal.client.Client] = None,
599
695
  environment_name: typing.Optional[str] = None,
600
- ): ...
696
+ ):
697
+ """mdmd:hidden
698
+ Delete a named Queue.
699
+
700
+ Warning: This deletes an *entire Queue*, not just a specific entry or partition.
701
+ Deletion is irreversible and will affect any Apps currently using the Queue.
702
+
703
+ DEPRECATED: This method is deprecated; we recommend using `modal.Queue.objects.delete` instead.
704
+ """
705
+ ...
706
+
601
707
  async def aio(
602
708
  self,
603
709
  /,
@@ -605,7 +711,16 @@ class Queue(modal.object.Object):
605
711
  *,
606
712
  client: typing.Optional[modal.client.Client] = None,
607
713
  environment_name: typing.Optional[str] = None,
608
- ): ...
714
+ ):
715
+ """mdmd:hidden
716
+ Delete a named Queue.
717
+
718
+ Warning: This deletes an *entire Queue*, not just a specific entry or partition.
719
+ Deletion is irreversible and will affect any Apps currently using the Queue.
720
+
721
+ DEPRECATED: This method is deprecated; we recommend using `modal.Queue.objects.delete` instead.
722
+ """
723
+ ...
609
724
 
610
725
  delete: __delete_spec
611
726