Skip to content

Commit

Permalink
feat: add deprecation warnings when loading several models
Browse files Browse the repository at this point in the history
This is required for #130, #128

Fixesd #129
  • Loading branch information
alvarolopez committed Mar 15, 2024
1 parent 99a1d14 commit e833458
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions deepaas/model/v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ def register_models(app):
LOG.warning("Error loading models: %s", e)

if MODELS:
if len(MODELS) > 1:
# Loading several models will be deprecated in the future
warn_msg = (
"Loading several models is deprecated."
)
warnings.warn(warn_msg, DeprecationWarning)
LOG.warning(warn_msg)

MODELS_LOADED = True
return

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ prelude: >
deprecations:
- Loading the default deepaas-test model if no models are available is now
marked as deprecated and will be removed in the next major version.
- Loading several models is now marked as deprecated.

0 comments on commit e833458

Please sign in to comment.