forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML][Pipelines] Validate pipeline node IO name on reserved word (Azur…
…e#28770) * validate keyword in IO of node(s) in pipeline * add test * move io name validation to builder and log warning * fix warning error * update warning message * update warning message
- Loading branch information
1 parent
c2264a1
commit e94435e
Showing
7 changed files
with
139 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...i-ml/tests/test_configs/dsl_pipeline/pipeline_with_keyword_in_node_io/downstream_node.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
$schema: https://azuremlschemas.azureedge.net/latest/commandComponent.schema.json | ||
type: command | ||
name: component_with_keys_in_inputs | ||
command: echo ${{inputs.keys}} | ||
inputs: | ||
keys: | ||
type: uri_folder | ||
environment: azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:1 |
8 changes: 8 additions & 0 deletions
8
...ure-ai-ml/tests/test_configs/dsl_pipeline/pipeline_with_keyword_in_node_io/inner_node.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
$schema: https://azuremlschemas.azureedge.net/latest/commandComponent.schema.json | ||
type: command | ||
name: component_with_keyword_in_outputs | ||
command: echo ${{outputs.__contains__}} | ||
outputs: | ||
__contains__: | ||
type: uri_folder | ||
environment: azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:1 |
25 changes: 25 additions & 0 deletions
25
.../azure-ai-ml/tests/test_configs/dsl_pipeline/pipeline_with_keyword_in_node_io/pipeline.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from pathlib import Path | ||
|
||
from azure.ai.ml import load_component | ||
from azure.ai.ml.dsl import pipeline | ||
|
||
upstream_component = load_component(Path(__file__).parent / "upstream_node.yml") | ||
downstream_component = load_component(Path(__file__).parent / "downstream_node.yml") | ||
inner_component = load_component(Path(__file__).parent / "inner_node.yml") | ||
|
||
|
||
@pipeline | ||
def pipeline_component_func(): | ||
node = inner_component() | ||
return {"__hash__": node.outputs["__contains__"]} | ||
|
||
|
||
@pipeline | ||
def pipeline_func(): | ||
upstream_node = upstream_component() | ||
downstream_node = downstream_component(keys=upstream_node.outputs["items"]) # noqa: F841 | ||
pipeline_component_func() | ||
|
||
|
||
pipeline_job = pipeline_func() | ||
pipeline_job.settings.default_compute = "cpu-cluster" |
8 changes: 8 additions & 0 deletions
8
...-ai-ml/tests/test_configs/dsl_pipeline/pipeline_with_keyword_in_node_io/upstream_node.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
$schema: https://azuremlschemas.azureedge.net/latest/commandComponent.schema.json | ||
type: command | ||
name: component_with_items_in_outputs | ||
command: echo ${{outputs.items}} | ||
outputs: | ||
items: | ||
type: uri_folder | ||
environment: azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:1 |