|
6 | 6 | import re |
7 | 7 | from typing import Any, Dict, Optional, Union |
8 | 8 |
|
9 | | -from azure.ai.ml._restclient.v2023_04_01_preview.models import CustomModelJobInput as RestCustomModelJobInput |
10 | | -from azure.ai.ml._restclient.v2023_04_01_preview.models import CustomModelJobOutput as RestCustomModelJobOutput |
| 9 | +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( |
| 10 | + CustomModelJobInput as RestCustomModelJobInput, |
| 11 | +) |
| 12 | +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( |
| 13 | + CustomModelJobOutput as RestCustomModelJobOutput, |
| 14 | +) |
11 | 15 | from azure.ai.ml._restclient.v2023_04_01_preview.models import InputDeliveryMode |
12 | 16 | from azure.ai.ml._restclient.v2023_04_01_preview.models import JobInput as RestJobInput |
13 | 17 | from azure.ai.ml._restclient.v2023_04_01_preview.models import JobInputType |
14 | 18 | from azure.ai.ml._restclient.v2023_04_01_preview.models import JobOutput as RestJobOutput |
15 | 19 | from azure.ai.ml._restclient.v2023_04_01_preview.models import JobOutputType, LiteralJobInput |
16 | | -from azure.ai.ml._restclient.v2023_04_01_preview.models import MLFlowModelJobInput as RestMLFlowModelJobInput |
17 | | -from azure.ai.ml._restclient.v2023_04_01_preview.models import MLFlowModelJobOutput as RestMLFlowModelJobOutput |
18 | | -from azure.ai.ml._restclient.v2023_04_01_preview.models import MLTableJobInput as RestMLTableJobInput |
19 | | -from azure.ai.ml._restclient.v2023_04_01_preview.models import MLTableJobOutput as RestMLTableJobOutput |
| 20 | +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( |
| 21 | + MLFlowModelJobInput as RestMLFlowModelJobInput, |
| 22 | +) |
| 23 | +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( |
| 24 | + MLFlowModelJobOutput as RestMLFlowModelJobOutput, |
| 25 | +) |
| 26 | +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( |
| 27 | + MLTableJobInput as RestMLTableJobInput, |
| 28 | +) |
| 29 | +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( |
| 30 | + MLTableJobOutput as RestMLTableJobOutput, |
| 31 | +) |
20 | 32 | from azure.ai.ml._restclient.v2023_04_01_preview.models import OutputDeliveryMode |
21 | | -from azure.ai.ml._restclient.v2023_04_01_preview.models import TritonModelJobInput as RestTritonModelJobInput |
22 | | -from azure.ai.ml._restclient.v2023_04_01_preview.models import TritonModelJobOutput as RestTritonModelJobOutput |
23 | | -from azure.ai.ml._restclient.v2023_04_01_preview.models import UriFileJobInput as RestUriFileJobInput |
24 | | -from azure.ai.ml._restclient.v2023_04_01_preview.models import UriFileJobOutput as RestUriFileJobOutput |
25 | | -from azure.ai.ml._restclient.v2023_04_01_preview.models import UriFolderJobInput as RestUriFolderJobInput |
26 | | -from azure.ai.ml._restclient.v2023_04_01_preview.models import UriFolderJobOutput as RestUriFolderJobOutput |
| 33 | +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( |
| 34 | + TritonModelJobInput as RestTritonModelJobInput, |
| 35 | +) |
| 36 | +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( |
| 37 | + TritonModelJobOutput as RestTritonModelJobOutput, |
| 38 | +) |
| 39 | +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( |
| 40 | + UriFileJobInput as RestUriFileJobInput, |
| 41 | +) |
| 42 | +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( |
| 43 | + UriFileJobOutput as RestUriFileJobOutput, |
| 44 | +) |
| 45 | +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( |
| 46 | + UriFolderJobInput as RestUriFolderJobInput, |
| 47 | +) |
| 48 | +from azure.ai.ml._restclient.v2023_04_01_preview.models import ( |
| 49 | + UriFolderJobOutput as RestUriFolderJobOutput, |
| 50 | +) |
27 | 51 | from azure.ai.ml._utils.utils import is_data_binding_expression |
28 | 52 | from azure.ai.ml.constants import AssetTypes, InputOutputModes, JobType |
29 | 53 | from azure.ai.ml.constants._component import IOConstants |
30 | 54 | from azure.ai.ml.entities._inputs_outputs import Input, Output |
31 | 55 | from azure.ai.ml.entities._job.input_output_entry import InputOutputEntry |
32 | 56 | from azure.ai.ml.entities._util import normalize_job_input_output_type |
33 | | -from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, JobException, ValidationErrorType, ValidationException |
| 57 | +from azure.ai.ml.exceptions import ( |
| 58 | + ErrorCategory, |
| 59 | + ErrorTarget, |
| 60 | + JobException, |
| 61 | + ValidationErrorType, |
| 62 | + ValidationException, |
| 63 | +) |
34 | 64 |
|
35 | 65 | INPUT_MOUNT_MAPPING_FROM_REST = { |
36 | 66 | InputDeliveryMode.READ_WRITE_MOUNT: InputOutputModes.RW_MOUNT, |
@@ -175,7 +205,8 @@ def validate_pipeline_input_key_characters(key: str) -> None: |
175 | 205 | # so a valid pipeline key is: ^{single_key}([.]{single_key})*$ |
176 | 206 | if re.match(IOConstants.VALID_KEY_PATTERN, key) is None: |
177 | 207 | msg = ( |
178 | | - "Pipeline input key name {} must be composed letters, numbers, and underscores with optional split by dots." |
| 208 | + "Pipeline input key name {} must be composed letters, numbers, and underscores with optional " |
| 209 | + "split by dots." |
179 | 210 | ) |
180 | 211 | raise ValidationException( |
181 | 212 | message=msg.format(key), |
@@ -229,7 +260,7 @@ def to_rest_dataset_literal_inputs( |
229 | 260 | if input_value.type in target_cls_dict: |
230 | 261 | input_data = target_cls_dict[input_value.type]( |
231 | 262 | uri=input_value.path, |
232 | | - mode=INPUT_MOUNT_MAPPING_TO_REST[input_value.mode.lower()] if input_value.mode else None, |
| 263 | + mode=(INPUT_MOUNT_MAPPING_TO_REST[input_value.mode.lower()] if input_value.mode else None), |
233 | 264 | ) |
234 | 265 |
|
235 | 266 | else: |
@@ -292,7 +323,7 @@ def from_rest_inputs_to_dataset_literal(inputs: Dict[str, RestJobInput]) -> Dict |
292 | 323 | input_data = Input( |
293 | 324 | type=type_transfer_dict[input_value.job_input_type], |
294 | 325 | path=path, |
295 | | - mode=INPUT_MOUNT_MAPPING_FROM_REST[input_value.mode] if input_value.mode else None, |
| 326 | + mode=(INPUT_MOUNT_MAPPING_FROM_REST[input_value.mode] if input_value.mode else None), |
296 | 327 | path_on_compute=sourcePathOnCompute, |
297 | 328 | ) |
298 | 329 | elif input_value.job_input_type in (JobInputType.LITERAL, JobInputType.LITERAL): |
@@ -337,7 +368,7 @@ def to_rest_data_outputs(outputs: Optional[Dict]) -> Dict[str, RestJobOutput]: |
337 | 368 | asset_name=output_value.name, |
338 | 369 | asset_version=output_value.version, |
339 | 370 | uri=output_value.path, |
340 | | - mode=OUTPUT_MOUNT_MAPPING_TO_REST[output_value.mode.lower()] if output_value.mode else None, |
| 371 | + mode=(OUTPUT_MOUNT_MAPPING_TO_REST[output_value.mode.lower()] if output_value.mode else None), |
341 | 372 | pathOnCompute=getattr(output_value, "path_on_compute", None), |
342 | 373 | description=output_value.description, |
343 | 374 | ) |
@@ -380,7 +411,7 @@ def from_rest_data_outputs(outputs: Dict[str, RestJobOutput]) -> Dict[str, Outpu |
380 | 411 | from_rest_outputs[output_name] = Output( |
381 | 412 | type=output_type_mapping[output_value.job_output_type], |
382 | 413 | path=output_value.uri, |
383 | | - mode=OUTPUT_MOUNT_MAPPING_FROM_REST[output_value.mode] if output_value.mode else None, |
| 414 | + mode=(OUTPUT_MOUNT_MAPPING_FROM_REST[output_value.mode] if output_value.mode else None), |
384 | 415 | path_on_compute=sourcePathOnCompute, |
385 | 416 | description=output_value.description, |
386 | 417 | name=output_value.asset_name, |
|
0 commit comments