Skip to content

Commit 872954e

Browse files
Update environment.py (#27005)
* Update environment.py Not setting this object (environment._translated_conda_file) causes a mismatch between the registered env and the loaded one which leads to re-register the existing env. This issue only happens with environment that includes conda file. * Update sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py Co-authored-by: Man <[email protected]> * Update CHANGELOG.md Co-authored-by: Man <[email protected]>
1 parent 1735d85 commit 872954e

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

sdk/ml/azure-ai-ml/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- MLClient.from_config can now find the default config.json on Compute Instance when running sample notebooks.
1414
- Registries now assign managed tags to match registry's tags.
1515
- Adjust registry experimental tags and imports to avoid warning printouts for unrelated operations.
16+
- Prevent registering an already existing environment that references conda file.
1617

1718
### Other Changes
1819

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py

+1
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ def _from_rest_object(cls, env_rest_object: EnvironmentVersionData) -> "Environm
232232
if rest_env_version.conda_file:
233233
translated_conda_file = yaml.safe_load(rest_env_version.conda_file)
234234
environment.conda_file = translated_conda_file
235+
environment._translated_conda_file = rest_env_version.conda_file
235236

236237
return environment
237238

0 commit comments

Comments
 (0)