|
5 | 5 | from pathlib import Path |
6 | 6 | from typing import List |
7 | 7 | import yaml |
8 | | -from aztk.spark import models |
| 8 | +from aztk import models |
9 | 9 | from aztk.utils import constants, file_utils, secure_utils |
10 | 10 | from aztk.error import InvalidCustomScriptError |
11 | 11 |
|
@@ -61,10 +61,12 @@ def add_files(self, file_paths: List[str], zip_dir, binary: bool = True): |
61 | 61 | for file in file_paths: |
62 | 62 | self.add_file(file, zip_dir, binary) |
63 | 63 |
|
64 | | - def add_dir(self, path: str, dest: str = None, exclude: List[str] = []): |
| 64 | + def add_dir(self, path: str, dest: str = None, exclude: List[str] = None): |
65 | 65 | """ |
66 | 66 | Zip all the files in the given directory into the zip file handler |
67 | 67 | """ |
| 68 | + exclude = exclude or [] |
| 69 | + |
68 | 70 | for base, _, files in os.walk(path): |
69 | 71 | relative_folder = os.path.relpath(base, path) |
70 | 72 | for file in files: |
@@ -156,7 +158,8 @@ def _add_plugins(self): |
156 | 158 | def _add_node_scripts(self): |
157 | 159 | self.add_dir(os.path.join(ROOT_PATH, NODE_SCRIPT_FOLDER), NODE_SCRIPT_FOLDER, exclude=['*.pyc*']) |
158 | 160 |
|
159 | | - def _includeFile(self, filename: str, exclude: List[str] = []) -> bool: |
| 161 | + def _includeFile(self, filename: str, exclude: List[str]) -> bool: |
| 162 | + exclude = exclude or [] |
160 | 163 | for pattern in exclude: |
161 | 164 | if fnmatch.fnmatch(filename, pattern): |
162 | 165 | return False |
|
0 commit comments