From fba8473d1f3697940711d8203cd3ef734cd76a29 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Mon, 15 Jul 2024 00:20:58 +0200 Subject: [PATCH] Fix circular dependency in hsml (CONNECTION_SAAS_HOSTNAME) --- python/hsml/client/__init__.py | 4 ++-- python/hsml/connection.py | 2 -- python/hsml/constants.py | 4 ++++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/python/hsml/client/__init__.py b/python/hsml/client/__init__.py index 3982f0c56..b3475258c 100644 --- a/python/hsml/client/__init__.py +++ b/python/hsml/client/__init__.py @@ -20,7 +20,7 @@ from hsml.client.istio import base as ist_base from hsml.client.istio import external as ist_external from hsml.client.istio import internal as ist_internal -from hsml.connection import CONNECTION_SAAS_HOSTNAME +from hsml.constants import CONNECTION _client_type = None @@ -49,7 +49,7 @@ def init( _client_type = client_type global _saas_connection - _saas_connection = host == CONNECTION_SAAS_HOSTNAME + _saas_connection = host == CONNECTION.SAAS_HOSTNAME global _hopsworks_client if not _hopsworks_client: diff --git a/python/hsml/connection.py b/python/hsml/connection.py index d9d61b9e8..c162a0a9f 100644 --- a/python/hsml/connection.py +++ b/python/hsml/connection.py @@ -22,8 +22,6 @@ from requests.exceptions import ConnectionError -CONNECTION_SAAS_HOSTNAME = "c.app.hopsworks.ai" - HOPSWORKS_PORT_DEFAULT = 443 HOSTNAME_VERIFICATION_DEFAULT = True diff --git a/python/hsml/constants.py b/python/hsml/constants.py index 6ec99ff3c..d7af16967 100644 --- a/python/hsml/constants.py +++ b/python/hsml/constants.py @@ -18,6 +18,10 @@ DEFAULT = dict() # used as default parameter for a class object +class CONNECTION: + SAAS_HOSTNAME = "c.app.hopsworks.ai" + + class MODEL: FRAMEWORK_TENSORFLOW = "TENSORFLOW" FRAMEWORK_TORCH = "TORCH"