Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
Raise appr error if model option is missing (#578)
Browse files Browse the repository at this point in the history
Make `--model` option required for `mlem deploy run ...` command
  • Loading branch information
mike0sv authored Jan 19, 2023
1 parent 3243f7e commit 892a039
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mlem/cli/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
from json import dumps
from typing import List, Optional

import click
from typer import Argument, Option, Typer
from typer.main import get_click_param
from typer.models import ParamMeta

from mlem.cli.apply import run_apply_remote
from mlem.cli.declare import add_env_params_deployment, process_fields
Expand Down Expand Up @@ -117,6 +120,14 @@ def deploy_run_command(
):
from mlem.api.commands import deploy

if model is None:
raise click.MissingParameter(
param=get_click_param(
ParamMeta(
name="model", default=option_model, annotation=str
)
)[0]
)
__kwargs__ = process_fields(type_name, MlemDeployment, __kwargs__)
_meta = build_mlem_object(
MlemDeployment,
Expand Down

0 comments on commit 892a039

Please sign in to comment.