Skip to content

Commit

Permalink
Expire deprecation of modal volume delete --confirm (#2355)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaskom authored Oct 18, 2024
1 parent 2ca9e46 commit 16eebe9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 0 additions & 10 deletions modal/cli/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from modal.cli.utils import ENV_OPTION, YES_OPTION, display_table, timestamp_to_local
from modal.client import _Client
from modal.environments import ensure_env
from modal.exception import deprecation_warning
from modal.volume import _Volume, _VolumeUploadContextManager
from modal_proto import api_pb2

Expand Down Expand Up @@ -278,17 +277,8 @@ async def cp(
async def delete(
volume_name: str = Argument(help="Name of the modal.Volume to be deleted. Case sensitive"),
yes: bool = YES_OPTION,
confirm: bool = Option(default=False, help="DEPRECATED: See `--yes` option"),
env: Optional[str] = ENV_OPTION,
):
if confirm:
deprecation_warning(
(2024, 4, 24),
"The `--confirm` option is deprecated; use `--yes` to delete without prompting.",
show_source=False,
)
yes = True

if not yes:
typer.confirm(
f"Are you sure you want to irrevocably delete the modal.Volume '{volume_name}'?",
Expand Down
2 changes: 2 additions & 0 deletions modal/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,8 @@ async def delete(*args, label: str = "", client: Optional[_Client] = None, envir
# TODO(michael) Upon enforcement of this deprecation, remove *args and the default argument for label=.
if args:
if isinstance(self := args[0], _Volume):
# TODO(michael) we have some second-thoughts about whether deletion methods
# should be static or instance. We might revert this, but there isn't consensus.
msg = (
"Calling Volume.delete as an instance method is deprecated."
" Please update your code to call it as a static method, passing"
Expand Down

0 comments on commit 16eebe9

Please sign in to comment.