From de2b4c82a64491b73ceca175ad2359a25eec1dff Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Wed, 17 Jul 2024 18:04:10 +0200 Subject: [PATCH] Adapt online_store_rest_client --- .../client/online_store_rest_client.py | 7 +++-- .../core/variable_api.py | 0 .../hsfs/client/online_store_rest_client.py | 28 +++++++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) rename python/{hopsworks => hopsworks_common}/core/variable_api.py (100%) create mode 100644 python/hsfs/client/online_store_rest_client.py diff --git a/python/hopsworks_common/client/online_store_rest_client.py b/python/hopsworks_common/client/online_store_rest_client.py index b733269a1..03d77471c 100644 --- a/python/hopsworks_common/client/online_store_rest_client.py +++ b/python/hopsworks_common/client/online_store_rest_client.py @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # + from __future__ import annotations import logging @@ -22,9 +23,9 @@ import requests import requests.adapters from furl import furl -from hsfs import client -from hsfs.client.exceptions import FeatureStoreException -from hsfs.core import variable_api +from hopsworks_common import client +from hopsworks_common.client.exceptions import FeatureStoreException +from hopsworks_common.core import variable_api _logger = logging.getLogger(__name__) diff --git a/python/hopsworks/core/variable_api.py b/python/hopsworks_common/core/variable_api.py similarity index 100% rename from python/hopsworks/core/variable_api.py rename to python/hopsworks_common/core/variable_api.py diff --git a/python/hsfs/client/online_store_rest_client.py b/python/hsfs/client/online_store_rest_client.py new file mode 100644 index 000000000..c75be81b7 --- /dev/null +++ b/python/hsfs/client/online_store_rest_client.py @@ -0,0 +1,28 @@ +# +# Copyright 2024 Hopsworks AB +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from hopsworks_common.client.online_store_rest_client import ( + OnlineStoreRestClientSingleton, + get_instance, + init_or_reset_online_store_rest_client, +) + + +__all__ = [ + OnlineStoreRestClientSingleton, + get_instance, + init_or_reset_online_store_rest_client, +]