|
6 | 6 |
|
7 | 7 | import json
|
8 | 8 | import os
|
| 9 | +from copy import deepcopy |
9 | 10 | from datetime import datetime
|
10 | 11 | from pathlib import Path
|
11 |
| -from typing import Dict, Optional, Union, List |
| 12 | +from typing import Dict, List, Optional, Union |
12 | 13 |
|
13 | 14 | from marshmallow.exceptions import ValidationError as SchemaValidationError
|
14 | 15 |
|
@@ -151,23 +152,24 @@ def begin_create_or_update(self, featureset: FeatureSet, **kwargs: Dict) -> LROP
|
151 | 152 | :return: An instance of LROPoller that returns a FeatureSet.
|
152 | 153 | :rtype: ~azure.core.polling.LROPoller[~azure.ai.ml.entities.FeatureSet]
|
153 | 154 | """
|
| 155 | + featureset_copy = deepcopy(featureset) |
154 | 156 |
|
155 |
| - featureset_spec = self._validate_and_get_feature_set_spec(featureset) |
156 |
| - featureset.properties["featuresetPropertiesVersion"] = "1" |
157 |
| - featureset.properties["featuresetProperties"] = json.dumps(featureset_spec._to_dict()) |
| 157 | + featureset_spec = self._validate_and_get_feature_set_spec(featureset_copy) |
| 158 | + featureset_copy.properties["featuresetPropertiesVersion"] = "1" |
| 159 | + featureset_copy.properties["featuresetProperties"] = json.dumps(featureset_spec._to_dict()) |
158 | 160 |
|
159 | 161 | sas_uri = None
|
160 |
| - featureset, _ = _check_and_upload_path( |
161 |
| - artifact=featureset, asset_operations=self, sas_uri=sas_uri, artifact_type=ErrorTarget.FEATURE_SET |
| 162 | + featureset_copy, _ = _check_and_upload_path( |
| 163 | + artifact=featureset_copy, asset_operations=self, sas_uri=sas_uri, artifact_type=ErrorTarget.FEATURE_SET |
162 | 164 | )
|
163 | 165 |
|
164 |
| - featureset_resource = FeatureSet._to_rest_object(featureset) |
| 166 | + featureset_resource = FeatureSet._to_rest_object(featureset_copy) |
165 | 167 |
|
166 | 168 | return self._operation.begin_create_or_update(
|
167 | 169 | resource_group_name=self._resource_group_name,
|
168 | 170 | workspace_name=self._workspace_name,
|
169 |
| - name=featureset.name, |
170 |
| - version=featureset.version, |
| 171 | + name=featureset_copy.name, |
| 172 | + version=featureset_copy.version, |
171 | 173 | body=featureset_resource,
|
172 | 174 | **kwargs,
|
173 | 175 | cls=lambda response, deserialized, headers: FeatureSet._from_rest_object(deserialized),
|
|
0 commit comments