diff --git a/opensearch_py_ml/ml_commons/model_train.py b/opensearch_py_ml/ml_commons/model_train.py index 476e6f45e..e10d24ffe 100644 --- a/opensearch_py_ml/ml_commons/model_train.py +++ b/opensearch_py_ml/ml_commons/model_train.py @@ -18,7 +18,7 @@ class ModelTrain: Class for training models using ML Commons train API. """ - API_ENDPOINT = "models/_train" + API_ENDPOINT = "_train" def __init__(self, os_client: OpenSearch): self._client = os_client @@ -38,7 +38,7 @@ def _train( return self._client.transport.perform_request( method="POST", - url=f"{ML_BASE_URI}/_train/{algorithm_name}", + url=f"{ML_BASE_URI}/{API_ENDPOINT}/{algorithm_name}", body=input_json, params=params, ) diff --git a/tests/conftest.py b/tests/conftest.py index 707dee6b4..93502fa0c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -23,11 +23,9 @@ # under the License. import inspect -import os import pandas as pd import pytest -from opensearchpy import OpenSearch import opensearch_py_ml as oml @@ -45,8 +43,6 @@ assert_series_equal, ) -pytest_plugins = ["tests.fixtures.index_fixtures"] - class SymmetricAPIChecker: def __init__(self, oml_obj, pd_obj): @@ -166,19 +162,3 @@ def df(): @pytest.fixture(scope="session") def testdata(): return TestData() - - -@pytest.fixture -def opensearch_client(): - opensearch_host = os.environ.get("OPENSEARCH_HOST", "https://localhost:9200") - opensearch_admin_user = os.environ.get("OPENSEARCH_ADMIN_USER", "admin") - opensearch_admin_password = os.environ.get("OPENSEARCH_ADMIN_PASSWORD", "admin") - client = OpenSearch( - hosts=[opensearch_host], - http_auth=(opensearch_admin_user, opensearch_admin_password), - verify_certs=False, - ) - yield client - - # tear down - client.transport.close()