Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ch-py-ml into kalyan/ml-commons-stats

Signed-off-by: kalyanr <[email protected]>
  • Loading branch information
rawwar committed Apr 15, 2024
2 parents 0f2c58b + 55b6f18 commit 04a2f24
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 26 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- use try-except-else block for handling unexpected exceptions during integration tests by @rawwar([#370](https://github.com/opensearch-project/opensearch-py-ml/pull/370))
- Removed pandas version pin in nox tests by @rawwar ([#368](https://github.com/opensearch-project/opensearch-py-ml/pull/368))
- Switch AL2 to AL2023 agent and DockerHub to ECR images in ml-models.JenkinsFile ([#377](https://github.com/opensearch-project/opensearch-py-ml/pull/377))
- Refactored validators in ML Commons' client([#385](https://github.com/opensearch-project/opensearch-py-ml/pull/385))

### Fixed
- Enable make_model_config_json to add model description to model config file by @thanawan-atc in ([#203](https://github.com/opensearch-project/opensearch-py-ml/pull/203))
Expand Down
6 changes: 4 additions & 2 deletions opensearch_py_ml/ml_commons/ml_commons_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
from opensearch_py_ml.ml_commons.model_connector import Connector
from opensearch_py_ml.ml_commons.model_execute import ModelExecute
from opensearch_py_ml.ml_commons.model_uploader import ModelUploader
from opensearch_py_ml.ml_commons.validators.profile import validate_profile_input
from opensearch_py_ml.ml_commons.validators.stats import validate_stats_input
from opensearch_py_ml.ml_commons.validators import (
validate_profile_input,
validate_stats_input,
)


class MLCommonClient:
Expand Down
2 changes: 1 addition & 1 deletion opensearch_py_ml/ml_commons/model_access_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from opensearchpy.exceptions import NotFoundError

from opensearch_py_ml.ml_commons.ml_common_utils import ML_BASE_URI
from opensearch_py_ml.ml_commons.validators.model_access_control import (
from opensearch_py_ml.ml_commons.validators import (
validate_create_model_group_parameters,
validate_delete_model_group_parameters,
validate_search_model_group_parameters,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,11 @@ def validate_delete_model_group_parameters(model_group_id: str):

def validate_search_model_group_parameters(query: dict):
_validate_model_group_query(query)


def validate_profile_input(path_parameter, payload):
if path_parameter is not None and not isinstance(path_parameter, str):
raise ValueError("path_parameter needs to be a string or None")

if payload is not None and not isinstance(payload, dict):
raise ValueError("payload needs to be a dictionary or None")
6 changes: 0 additions & 6 deletions opensearch_py_ml/ml_commons/validators/__init__.py

This file was deleted.

16 changes: 0 additions & 16 deletions opensearch_py_ml/ml_commons/validators/profile.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import pytest

from opensearch_py_ml.ml_commons.validators.model_access_control import (
from opensearch_py_ml.ml_commons.validators import (
_validate_model_group_access_mode,
_validate_model_group_add_all_backend_roles,
_validate_model_group_backend_roles,
Expand Down

0 comments on commit 04a2f24

Please sign in to comment.