Skip to content

Commit 9a090a3

Browse files
committedJul 11, 2024
Attempt to solve circular dependency problem with model_fixtures
1 parent acf485b commit 9a090a3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎python/hopsworks/util.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
from json import JSONEncoder
1818
from urllib.parse import urljoin, urlparse
1919

20-
from hopsworks import client
21-
from hopsworks.client.exceptions import JobException
22-
from hopsworks.git_file_status import GitFileStatus
23-
2420

2521
class Encoder(JSONEncoder):
2622
def default(self, obj):
@@ -39,6 +35,7 @@ def convert_to_abs(path, current_proj_name):
3935

4036

4137
def validate_job_conf(config, project_name):
38+
from hopsworks.client.exceptions import JobException
4239
# User is required to set the appPath programmatically after getting the configuration
4340
if (
4441
config["type"] != "dockerJobConfiguration"
@@ -60,6 +57,7 @@ def validate_job_conf(config, project_name):
6057

6158

6259
def convert_git_status_to_files(files):
60+
from hopsworks.git_file_status import GitFileStatus
6361
# Convert GitFileStatus to list of file paths
6462
if isinstance(files[0], GitFileStatus):
6563
tmp_files = []
@@ -77,6 +75,7 @@ def get_hostname_replaced_url(sub_path: str):
7775
:param sub_path: url sub-path after base url
7876
:return: href url
7977
"""
78+
from hopsworks import client
8079
href = urljoin(client.get_instance()._base_url, sub_path)
8180
url_parsed = client.get_instance().replace_public_host(urlparse(href))
8281
return url_parsed.geturl()

0 commit comments

Comments
 (0)