Skip to content

Commit ce6dd3a

Browse files
committed
Add exception - run_predictin
1 parent 105800c commit ce6dd3a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

superannotate/parameter_decorators.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from inspect import signature
33

44
from .common import project_type_int_to_str
5+
from .common import upload_state_str_to_int
56
from .db.project_api import get_project_metadata_bare
67
from .exceptions import SABaseException
78
from .ml.ml_models import search_models
@@ -50,6 +51,12 @@ def inner(*args, **kwargs):
5051
0,
5152
"The 'project' argument should be a dict, a string, a list of strings or a list of dicts"
5253
)
54+
55+
if new_kwargs["project"]["upload_state"] == upload_state_str_to_int("External"):
56+
raise SABaseException(
57+
0,
58+
f"The function does not support projects containing {new_kwargs['project']['type']} attached with URLs"
59+
)
5360
return func(**new_kwargs)
5461

5562
return inner

0 commit comments

Comments
 (0)