17
17
from json import JSONEncoder
18
18
from urllib .parse import urljoin , urlparse
19
19
20
- from hopsworks import client
21
- from hopsworks .client .exceptions import JobException
22
- from hopsworks .git_file_status import GitFileStatus
23
-
24
20
25
21
class Encoder (JSONEncoder ):
26
22
def default (self , obj ):
@@ -39,6 +35,7 @@ def convert_to_abs(path, current_proj_name):
39
35
40
36
41
37
def validate_job_conf (config , project_name ):
38
+ from hopsworks .client .exceptions import JobException
42
39
# User is required to set the appPath programmatically after getting the configuration
43
40
if (
44
41
config ["type" ] != "dockerJobConfiguration"
@@ -60,6 +57,7 @@ def validate_job_conf(config, project_name):
60
57
61
58
62
59
def convert_git_status_to_files (files ):
60
+ from hopsworks .git_file_status import GitFileStatus
63
61
# Convert GitFileStatus to list of file paths
64
62
if isinstance (files [0 ], GitFileStatus ):
65
63
tmp_files = []
@@ -77,6 +75,7 @@ def get_hostname_replaced_url(sub_path: str):
77
75
:param sub_path: url sub-path after base url
78
76
:return: href url
79
77
"""
78
+ from hopsworks import client
80
79
href = urljoin (client .get_instance ()._base_url , sub_path )
81
80
url_parsed = client .get_instance ().replace_public_host (urlparse (href ))
82
81
return url_parsed .geturl ()
0 commit comments