Skip to content

Commit

Permalink
Resolve circular dependencies
Browse files Browse the repository at this point in the history
By temporally removing connection from hsfs and hsml.
  • Loading branch information
aversey committed Jul 1, 2024
1 parent 0ce600f commit ac1d529
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
6 changes: 5 additions & 1 deletion python/hopsworks/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from __future__ import annotations

import json
from typing import TYPE_CHECKING

import humps
from hopsworks import client, constants, util
Expand All @@ -29,7 +30,10 @@
kafka_api,
opensearch_api,
)
from hsfs import feature_store


if TYPE_CHECKING:
from hsfs import feature_store


class Project:
Expand Down
7 changes: 1 addition & 6 deletions python/hsfs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"]
5 changes: 1 addition & 4 deletions python/hsml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
import warnings

from hsml import util, version
from hsml.connection import Connection


connection = Connection.connection

__version__ = version.__version__


Expand All @@ -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__ = []

0 comments on commit ac1d529

Please sign in to comment.