diff --git a/python/hopsworks/project.py b/python/hopsworks/project.py index f6d9d14c0..a07cd0279 100644 --- a/python/hopsworks/project.py +++ b/python/hopsworks/project.py @@ -16,6 +16,7 @@ from __future__ import annotations import json +from typing import TYPE_CHECKING import humps from hopsworks import client, constants, util @@ -29,7 +30,10 @@ kafka_api, opensearch_api, ) -from hsfs import feature_store + + +if TYPE_CHECKING: + from hsfs import feature_store class Project: diff --git a/python/hsfs/__init__.py b/python/hsfs/__init__.py index 31a5b433c..d9c6c2f91 100644 --- a/python/hsfs/__init__.py +++ b/python/hsfs/__init__.py @@ -27,15 +27,10 @@ util, version, ) -from hsfs.connection import ( # noqa: E402, Module level import not at top of file because os.environ must be set before importing hsfs - Connection, -) __version__ = version.__version__ -connection = Connection.connection - def fs_formatwarning(message, category, filename, lineno, line=None): return "{}: {}\n".format(category.__name__, message) @@ -56,4 +51,4 @@ def get_sdk_info(): return usage.get_env() -__all__ = ["connection", "disable_usage_logging", "get_sdk_info"] +__all__ = ["disable_usage_logging", "get_sdk_info"] diff --git a/python/hsml/__init__.py b/python/hsml/__init__.py index 4fb8156e3..9e8f97632 100644 --- a/python/hsml/__init__.py +++ b/python/hsml/__init__.py @@ -17,11 +17,8 @@ import warnings from hsml import util, version -from hsml.connection import Connection -connection = Connection.connection - __version__ = version.__version__ @@ -32,4 +29,4 @@ def ml_formatwarning(message, category, filename, lineno, line=None): warnings.formatwarning = ml_formatwarning warnings.simplefilter("always", util.VersionWarning) -__all__ = ["connection"] +__all__ = []