Skip to content

Commit 9c908dd

Browse files
authored
Renyix/data import (Azure#29460)
* Resolve Azure SDK comments * Update test recording files * Update change log * Remove unused import to fix pyint build check * Merge load_data_import back yo load_data * Remove unused import to fix pyint build check * Fix {name} to v2 ${{name}} * Update recordings for data_import e2etests * Add test validation for the change of {name} to ${{name}}
1 parent 29610bb commit 9c908dd

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/operations/_data_operations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,8 @@ def import_data(self, data_import: DataImport, **kwargs) -> PipelineJob:
370370

371371
experiment_name = "data_import_" + data_import.name
372372
data_import.type = AssetTypes.MLTABLE if isinstance(data_import.source, Database) else AssetTypes.URI_FOLDER
373-
if "{name}" not in data_import.path:
374-
data_import.path = data_import.path.rstrip("/") + "/{name}"
373+
if "${{name}}" not in data_import.path:
374+
data_import.path = data_import.path.rstrip("/") + "/${{name}}"
375375
import_job = import_data_func(
376376
description=data_import.description or experiment_name,
377377
display_name=experiment_name,

sdk/ml/azure-ai-ml/tests/data_import/e2etests/test_data_import.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def test_data_import(self, client: MLClient) -> None:
2626
assert isinstance(data_import, DataImport)
2727
assert data_import.name == job.outputs["sink"].name
2828
assert data_import.path == job.outputs["sink"].path
29+
assert data_import.path == "azureml://datastores/workspaceblobstore/paths/${{name}}"
2930

3031
assert isinstance(data_import.source, Database)
3132
assert isinstance(job.source, Database)

sdk/ml/azure-ai-ml/tests/recordings/data_import/e2etests/test_data_import.pyTestDataImporttest_data_import.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"Accept": "application/json",
88
"Accept-Encoding": "gzip, deflate",
99
"Connection": "keep-alive",
10-
"Content-Length": "1083",
10+
"Content-Length": "1086",
1111
"Content-Type": "application/json",
1212
"User-Agent": "azure-ai-ml/1.6.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.10.6 (Windows-10-10.0.22621-SP0)"
1313
},
@@ -36,7 +36,7 @@
3636
"computeId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/workspaces/00000/computes/serverless",
3737
"outputs": {
3838
"sink": {
39-
"uri": "azureml://datastores/workspaceblobstore/paths/{name}",
39+
"uri": "azureml://datastores/workspaceblobstore/paths/${{name}}",
4040
"job_output_type": "mltable",
4141
"name": "my_azuresqldb_asset"
4242
}
@@ -55,22 +55,22 @@
5555
"StatusCode": 201,
5656
"ResponseHeaders": {
5757
"Cache-Control": "no-cache",
58-
"Content-Length": "2461",
58+
"Content-Length": "3118",
5959
"Content-Type": "application/json; charset=utf-8",
60-
"Date": "Wed, 15 Mar 2023 19:20:17 GMT",
60+
"Date": "Mon, 20 Mar 2023 19:53:43 GMT",
6161
"Expires": "-1",
6262
"Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/workspaces/00000/jobs/000000000000000000000?api-version=2023-02-01-preview",
6363
"Pragma": "no-cache",
6464
"request-context": "appId=cid-v1:512cc15a-13b5-415b-bfd0-dce7accb6bb1",
65-
"Server-Timing": "traceparent;desc=\u002200-c82ed271972e0ae80aea387985bd0994-31af1a355d305790-01\u0022",
65+
"Server-Timing": "traceparent;desc=\u002200-09a8879e50d292259d838f37d0c859f8-14d9f799337e7818-01\u0022",
6666
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
6767
"x-aml-cluster": "vienna-test-westus2-01",
6868
"X-Content-Type-Options": "nosniff",
69-
"x-ms-correlation-request-id": "88fe5c87-cb15-4495-bada-9bd1021811b4",
69+
"x-ms-correlation-request-id": "19c0de80-d5dd-47f1-9671-6633d58b53f4",
7070
"x-ms-ratelimit-remaining-subscription-writes": "1199",
7171
"x-ms-response-type": "standard",
72-
"x-ms-routing-request-id": "WESTUS:20230315T192018Z:88fe5c87-cb15-4495-bada-9bd1021811b4",
73-
"x-request-time": "4.314"
72+
"x-ms-routing-request-id": "WESTCENTRALUS:20230320T195343Z:19c0de80-d5dd-47f1-9671-6633d58b53f4",
73+
"x-request-time": "3.803"
7474
},
7575
"ResponseBody": {
7676
"id": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/workspaces/00000/jobs/000000000000000000000",
@@ -138,7 +138,7 @@
138138
"computeId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/workspaces/00000/computes/serverless",
139139
"outputs": {
140140
"sink": {
141-
"uri": "azureml://datastores/workspaceblobstore/paths/{name}",
141+
"uri": "azureml://datastores/workspaceblobstore/paths/${{name}}",
142142
"job_output_type": "mltable",
143143
"name": "my_azuresqldb_asset"
144144
}
@@ -152,8 +152,8 @@
152152
"sourceJobId": null
153153
},
154154
"systemData": {
155-
"createdAt": "2023-03-15T19:20:17.7591391\u002B00:00",
156-
"createdBy": "Firstname Lastname",
155+
"createdAt": "2023-03-20T19:53:42.9619681\u002B00:00",
156+
"createdBy": "Renyi Xiong",
157157
"createdByType": "User"
158158
}
159159
}

0 commit comments

Comments
 (0)