Skip to content

Commit ac1d529

Browse files
committedJul 1, 2024
Resolve circular dependencies
By temporally removing connection from hsfs and hsml.
1 parent 0ce600f commit ac1d529

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed
 

‎python/hopsworks/project.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from __future__ import annotations
1717

1818
import json
19+
from typing import TYPE_CHECKING
1920

2021
import humps
2122
from hopsworks import client, constants, util
@@ -29,7 +30,10 @@
2930
kafka_api,
3031
opensearch_api,
3132
)
32-
from hsfs import feature_store
33+
34+
35+
if TYPE_CHECKING:
36+
from hsfs import feature_store
3337

3438

3539
class Project:

‎python/hsfs/__init__.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,10 @@
2727
util,
2828
version,
2929
)
30-
from hsfs.connection import ( # noqa: E402, Module level import not at top of file because os.environ must be set before importing hsfs
31-
Connection,
32-
)
3330

3431

3532
__version__ = version.__version__
3633

37-
connection = Connection.connection
38-
3934

4035
def fs_formatwarning(message, category, filename, lineno, line=None):
4136
return "{}: {}\n".format(category.__name__, message)
@@ -56,4 +51,4 @@ def get_sdk_info():
5651
return usage.get_env()
5752

5853

59-
__all__ = ["connection", "disable_usage_logging", "get_sdk_info"]
54+
__all__ = ["disable_usage_logging", "get_sdk_info"]

‎python/hsml/__init__.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@
1717
import warnings
1818

1919
from hsml import util, version
20-
from hsml.connection import Connection
2120

2221

23-
connection = Connection.connection
24-
2522
__version__ = version.__version__
2623

2724

@@ -32,4 +29,4 @@ def ml_formatwarning(message, category, filename, lineno, line=None):
3229
warnings.formatwarning = ml_formatwarning
3330
warnings.simplefilter("always", util.VersionWarning)
3431

35-
__all__ = ["connection"]
32+
__all__ = []

0 commit comments

Comments
 (0)