utils
deployer.utils.models
create_model_from_func
create_model_from_func(
func: Callable,
model_name: Optional[str] = None,
type_converter: Optional[TypeConverterType] = None,
exclude_defaults: bool = False,
) -> CustomBaseModel
Create a Pydantic model from pipeline parameters.
Source code in deployer/utils/models.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
deployer.utils.utils
make_enum_from_python_package_dir
make_enum_from_python_package_dir(
dir_path: Path, raise_if_not_found: bool = False
) -> Enum
Create an Enum of file names without extention from a directory of python modules.
Source code in deployer/utils/utils.py
19 20 21 22 23 24 25 26 27 |
|
import_pipeline_from_dir
import_pipeline_from_dir(
dirpath: Path, pipeline_name: str
) -> GraphComponentType
Import a pipeline from a directory.
Source code in deployer/utils/utils.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|
deployer.utils.config
VertexPipelinesSettings
Bases: BaseSettings
Source code in deployer/utils/config.py
21 22 23 24 25 26 27 28 29 |
|
load_vertex_settings
load_vertex_settings(
env_file: Optional[Path] = None,
) -> VertexPipelinesSettings
Load the settings from the environment.
Source code in deployer/utils/config.py
32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
list_config_filepaths
list_config_filepaths(
configs_root_path: Path, pipeline_name: str
) -> List[Path]
List the config filepaths for a pipeline.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
configs_root_path
|
Path
|
A |
required |
pipeline_name
|
str
|
The name of the pipeline. |
required |
Returns:
Type | Description |
---|---|
List[Path]
|
List[Path]: A list of |
Source code in deployer/utils/config.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
load_config
load_config(
config_filepath: Path,
) -> Tuple[Optional[dict], Optional[dict]]
Load the parameter values and input artifacts from a config file.
Config file can be a JSON or Python file.
- If JSON, it should be a dict of parameter values.
- If Python, it should contain a parameter_values
dict
and / or an input_artifacts
dict.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_filepath
|
Path
|
A |
required |
Returns:
Type | Description |
---|---|
Tuple[Optional[dict], Optional[dict]]
|
Tuple[Optional[dict], Optional[dict]]:: A tuple containing the loaded parameter values
and input artifacts (or |
Raises:
Type | Description |
---|---|
UnsupportedConfigFileError
|
If the file has an unsupported extension. |
Source code in deployer/utils/config.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
|
_load_config_python
_load_config_python(
config_filepath: Path,
) -> Tuple[Optional[dict], Optional[dict]]
Load the parameter values and input artifacts from a Python config file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_filepath
|
Path
|
A |
required |
Returns:
Type | Description |
---|---|
Tuple[Optional[dict], Optional[dict]]
|
Tuple[Optional[dict], Optional[dict]]: A tuple containing the loaded parameter values
(or |
Raises:
Type | Description |
---|---|
ValueError
|
If the config file does not contain a |
ValueError
|
If the config file contains common keys in |
Source code in deployer/utils/config.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
|
_load_config_yaml
_load_config_yaml(config_filepath: Path) -> dict
Load the parameter values from a YAML config file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_filepath
|
Path
|
A |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
The loaded parameter values. |
Source code in deployer/utils/config.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
|
_load_config_toml
_load_config_toml(config_filepath: Path) -> dict
Load the parameter values from a TOML config file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_filepath
|
Path
|
A |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
The loaded parameter values. |
Source code in deployer/utils/config.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
|