forked from opensearch-project/opensearch-py-ml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
opensearch-project#285: Add support for Model profile (opensearch-pro…
…ject#358) * init Signed-off-by: kalyanr <[email protected]> * update changelog Signed-off-by: kalyanr <[email protected]> * update Signed-off-by: kalyanr <[email protected]> * fix Signed-off-by: kalyanr <[email protected]> * fix Signed-off-by: kalyanr <[email protected]> * lint fix Signed-off-by: kalyanr <[email protected]> * reuse validate input Signed-off-by: kalyanr <[email protected]> * update comment Signed-off-by: kalyanr <[email protected]> * change Signed-off-by: kalyanr <[email protected]> * fix Signed-off-by: kalyanr <[email protected]> * update changelog Signed-off-by: kalyanr <[email protected]> * fix Signed-off-by: kalyanr <[email protected]> * remove separate model profile module Signed-off-by: kalyanr <[email protected]> * fix tests Signed-off-by: kalyanr <[email protected]> * fix lint Signed-off-by: kalyanr <[email protected]> * fix lint Signed-off-by: kalyanr <[email protected]> * fix Signed-off-by: kalyanr <[email protected]> * Update ml_commons_client.py Signed-off-by: Kalyan <[email protected]> --------- Signed-off-by: kalyanr <[email protected]> Signed-off-by: Kalyan <[email protected]>
- Loading branch information
Showing
4 changed files
with
188 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
# Any modifications Copyright OpenSearch Contributors. See | ||
# GitHub history for details. | ||
|
||
"""Module for validating Profile API parameters """ | ||
|
||
|
||
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters