Skip to content

Commit bacc704

Browse files
YingChen1996Ying Chen
andauthored
Enable test_command_job_with_invalid_mode_type_in_pipeline_deserialize (Azure#27662)
* enable test * format * format * update Co-authored-by: Ying Chen <2601502859@qq.com>
1 parent 50ef5f0 commit bacc704

File tree

2 files changed

+32
-33
lines changed

2 files changed

+32
-33
lines changed

sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,9 @@ def test_invalid_pipeline_jobs_descerialize(self, invalid_pipeline_job_without_j
194194
pipeline = load_pipeline_entity_from_rest_json(job_dict)
195195
assert pipeline.jobs == {}
196196

197-
@pytest.mark.skip("azure.ai.ml.exceptions.ValidationException: Job input type None is not supported as job input.")
198197
def test_command_job_with_invalid_mode_type_in_pipeline_deserialize(self):
198+
# this json file is to test whether the client can handle the dirty data of node type/mode of the originally
199+
# submitted job due to API switching
199200
rest_job_file = "./tests/test_configs/pipeline_jobs/invalid/with_invalid_job_input_type_mode.json"
200201
with open(rest_job_file, "r") as f:
201202
job_dict = yaml.safe_load(f)
@@ -206,16 +207,17 @@ def test_command_job_with_invalid_mode_type_in_pipeline_deserialize(self):
206207
"hello_python_world_job": {
207208
"inputs": {
208209
"sample_input_data": {
210+
'mode': "ro_mount",
209211
"type": "uri_folder",
210-
"path": "azureml://datastores/workspaceblobstore/paths/LocalUpload/553d1a28-7933-4017-8321-96c2a9f1fc44/data/",
212+
'path': "azureml://datastores/workspaceblobstore/paths/LocalUpload/22fd2a62-9759-4843-ab92-5bd79c35f6f0/data/",
211213
},
212214
"sample_input_string": {
213215
"mode": "ro_mount",
214216
"path": "${{parent.inputs.pipeline_sample_input_string}}",
215217
},
216218
},
217219
"outputs": {"sample_output_data": "${{parent.outputs.pipeline_sample_output_data}}"},
218-
"component": "azureml:/subscriptions/96aede12-2f73-41cb-b983-6d11a904839b/resourceGroups/sdk/providers/Microsoft.MachineLearningServices/workspaces/sdk-master/components/azureml_anonymous/versions/6ffc3ff9-8801-4cc4-9285-9f8052b946fe",
220+
'component': "azureml:/subscriptions/96aede12-2f73-41cb-b983-6d11a904839b/resourceGroups/chenyin-test-eastus/providers/Microsoft.MachineLearningServices/workspaces/sdk_vnext_cli/components/azureml_anonymous/versions/9904ff48-9cb2-4733-ad1c-eb1eb9940a19",
219221
"type": "command",
220222
"compute": "azureml:cpu-cluster",
221223
}
Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
11
{
2-
"id": "/subscriptions/96aede12-2f73-41cb-b983-6d11a904839b/resourceGroups/sdk/providers/Microsoft.MachineLearningServices/workspaces/sdk-master/jobs/test_580619710376",
3-
"name": "test_580619710376",
2+
"id": "/subscriptions/96aede12-2f73-41cb-b983-6d11a904839b/resourceGroups/chenyin-test-eastus/providers/Microsoft.MachineLearningServices/workspaces/sdk_vnext_cli/jobs/test_240010912529",
3+
"name": "test_240010912529",
44
"type": "Microsoft.MachineLearningServices/workspaces/jobs",
55
"system_data": {
66
"created_by": "Ying Chen",
77
"created_by_type": "User",
8-
"created_at": "2022-09-06T07:01:37.065408Z"
8+
"created_at": "2022-11-23T09:27:21.69252Z",
99
},
1010
"properties": {
1111
"description": "Example of using data in a local folder as pipeline input",
1212
"properties": {
1313
"mlflow.source.git.repoURL": "msdata@vs-ssh.visualstudio.com:v3/msdata/Vienna/sdk-cli-v2",
14-
"mlflow.source.git.branch": "chenyin/parse_job_none",
15-
"mlflow.source.git.commit": "93afd7f355cc878a3c6348542a67ad1e62db5c49",
14+
"mlflow.source.git.branch": "chenyin/add_pipeline_e2e_test",
15+
"mlflow.source.git.commit": "a0802beac4bfc4a23eea2f9e820f067c186d6499",
1616
"azureml.git.dirty": "True",
1717
"azureml.DevPlatv2": "true",
1818
"azureml.runsource": "azureml.PipelineRun",
1919
"runSource": "MFE",
2020
"runType": "HTTP",
21-
"azureml.parameters": "{'pipeline_sample_input_string':'Hello_Pipeline_World'}",
21+
"azureml.parameters": '{"pipeline_sample_input_string":"Hello_Pipeline_World"}',
2222
"azureml.continue_on_step_failure": "False",
2323
"azureml.continue_on_failed_optional_input": "True",
2424
"azureml.defaultDataStoreName": "workspaceblobstore",
25-
"azureml.pipelineComponent": "pipelinerun"
25+
"azureml.pipelineComponent": "pipelinerun",
2626
},
2727
"tags": {},
2828
"display_name": "4a_local_data_input",
29-
"experiment_name": "azure-ai-ml",
30-
"is_archived": false,
29+
"experiment_name": "sdk-cli-v2",
30+
"is_archived": False,
3131
"job_type": "Pipeline",
3232
"services": {
3333
"Tracking": {
34-
"endpoint": "azureml://master.api.azureml-test.ms/mlflow/v1.0/subscriptions/96aede12-2f73-41cb-b983-6d11a904839b/resourceGroups/sdk/providers/Microsoft.MachineLearningServices/workspaces/sdk-master?",
35-
"job_service_type": "Tracking"
34+
"endpoint": "azureml://eastus.api.azureml.ms/mlflow/v1.0/subscriptions/96aede12-2f73-41cb-b983-6d11a904839b/resourceGroups/chenyin-test-eastus/providers/Microsoft.MachineLearningServices/workspaces/sdk_vnext_cli?",
35+
"job_service_type": "Tracking",
3636
},
3737
"Studio": {
38-
"endpoint": "https://ml.azure.com/runs/test_580619710376?wsid=/subscriptions/96aede12-2f73-41cb-b983-6d11a904839b/resourcegroups/sdk/workspaces/sdk-master",
39-
"job_service_type": "Studio"
40-
}
38+
"endpoint": "https://ml.azure.com/runs/test_240010912529?wsid=/subscriptions/96aede12-2f73-41cb-b983-6d11a904839b/resourcegroups/chenyin-test-eastus/workspaces/sdk_vnext_cli",
39+
"job_service_type": "Studio",
40+
},
4141
},
4242
"status": "Preparing",
4343
"inputs": {
4444
"pipeline_sample_input_string": {
45-
"job_input_type": "Literal",
46-
"value": "Hello_Pipeline_World"
45+
"job_input_type": "literal",
46+
"value": "Hello_Pipeline_World",
4747
}
4848
},
4949
"jobs": {
@@ -53,39 +53,36 @@
5353
"limits": null,
5454
"environment_variables": {},
5555
"name": "hello_python_world_job",
56-
"type": "command",
5756
"display_name": null,
5857
"tags": {},
59-
"computeId": "/subscriptions/96aede12-2f73-41cb-b983-6d11a904839b/resourceGroups/sdk/providers/Microsoft.MachineLearningServices/workspaces/sdk-master/computes/cpu-cluster",
58+
"computeId": "/subscriptions/96aede12-2f73-41cb-b983-6d11a904839b/resourceGroups/chenyin-test-eastus/providers/Microsoft.MachineLearningServices/workspaces/sdk_vnext_cli/computes/cpu-cluster",
6059
"inputs": {
6160
"sample_input_string": {
6261
"job_input_type": "Literal",
6362
"value": "${{parent.inputs.pipeline_sample_input_string}}",
64-
"mode": "RoMount"
63+
"mode": "RoMount",
6564
},
6665
"sample_input_data": {
67-
"uri": "azureml://datastores/workspaceblobstore/paths/LocalUpload/553d1a28-7933-4017-8321-96c2a9f1fc44/data/",
68-
"job_input_type": "UriFolder"
69-
}
66+
"mode": "ReadOnlyMount",
67+
"uri": "azureml://datastores/workspaceblobstore/paths/LocalUpload/22fd2a62-9759-4843-ab92-5bd79c35f6f0/data/",
68+
"job_input_type": "UriFolder",
69+
},
7070
},
7171
"outputs": {
7272
"sample_output_data": {
7373
"value": "${{parent.outputs.pipeline_sample_output_data}}",
74-
"type": "Literal"
74+
"type": "Literal",
7575
}
7676
},
77-
"_source": "YAML.JOB",
78-
"componentId": "/subscriptions/96aede12-2f73-41cb-b983-6d11a904839b/resourceGroups/sdk/providers/Microsoft.MachineLearningServices/workspaces/sdk-master/components/azureml_anonymous/versions/6ffc3ff9-8801-4cc4-9285-9f8052b946fe"
77+
"componentId": "/subscriptions/96aede12-2f73-41cb-b983-6d11a904839b/resourceGroups/chenyin-test-eastus/providers/Microsoft.MachineLearningServices/workspaces/sdk_vnext_cli/components/azureml_anonymous/versions/9904ff48-9cb2-4733-ad1c-eb1eb9940a19",
7978
}
8079
},
8180
"outputs": {
8281
"pipeline_sample_output_data": {
8382
"mode": "Upload",
84-
"job_output_type": "UriFolder"
83+
"job_output_type": "uri_folder",
8584
}
8685
},
87-
"settings": {
88-
"_source": "YAML.JOB"
89-
}
90-
}
86+
"settings": {},
87+
},
9188
}

0 commit comments

Comments
 (0)