Skip to content

Commit

Permalink
feat: add deprecation warnings for test module
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarolopez committed Mar 15, 2024
1 parent 594e084 commit 324bf9e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions deepaas/model/v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# License for the specific language governing permissions and limitations
# under the License.

import warnings

from oslo_log import log

from deepaas.model import loading
Expand Down Expand Up @@ -45,7 +47,15 @@ def register_models(app):
return

if not MODELS:
# Raise deprecation warning
warn_msg = (
"Using the built-in test model is deprecated, if you are testing the "
"API, please use the demo_app instead. "
"Check https://github.com/deephdc/demo_app for more information.",
)
warnings.warn(warn_msg, DeprecationWarning)
LOG.info("No models found in V2, loading test model")
LOG.warning(warn_msg)
MODELS["deepaas-test"] = wrapper.ModelWrapper(
"deepaas-test", test.TestModel(), app
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
prelude: >
Model loading is being refactored, so that only a single model will be
available for serving.
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.

0 comments on commit 324bf9e

Please sign in to comment.