Skip to content

Commit 49b442b

Browse files
author
Valentin Thorey
authored
Make make_zipfile 'private' (#183)
1 parent d1acf60 commit 49b442b

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

dataikuapi/dss/savedmodel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from .ml import DSSTrainedClusteringModelDetails
66
from .ml import DSSTrainedPredictionModelDetails
77

8-
from ..utils import make_zipfile
8+
from ..utils import _make_zipfile
99

1010
try:
1111
basestring
@@ -141,7 +141,7 @@ def import_mlflow_version_from_path(self, version_id, path, code_env_name="INHER
141141

142142
archive_temp_dir = tempfile.mkdtemp()
143143
try:
144-
archive_filename = make_zipfile(os.path.join(archive_temp_dir, "tmpmodel.zip"), path)
144+
archive_filename = _make_zipfile(os.path.join(archive_temp_dir, "tmpmodel.zip"), path)
145145

146146
with open(archive_filename, "rb") as fp:
147147
self.client._perform_empty("POST", "/projects/%s/savedmodels/%s/versions/%s?codeEnvName=%s" % (self.project_key, self.sm_id, version_id, code_env_name),

dataikuapi/utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,7 @@ def __call__(self):
104104
return self.val
105105

106106

107-
def make_zipfile(output_filename, source_dir):
108-
"""Replace shutil.make_archive which adds undesired folders to the archive
109-
in python 2.7 in some environments.
110-
"""
107+
def _make_zipfile(output_filename, source_dir):
111108
relroot = os.path.abspath(os.path.join(source_dir))
112109
with zipfile.ZipFile(output_filename, "w", zipfile.ZIP_DEFLATED) as zipfp:
113110
for root, dirs, files in os.walk(source_dir):

0 commit comments

Comments
 (0)