Skip to content

Commit

Permalink
Update environment.py (Azure#27005)
Browse files Browse the repository at this point in the history
* 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 <43016276+Man-MSFT@users.noreply.github.com>

* Update CHANGELOG.md

Co-authored-by: Man <43016276+Man-MSFT@users.noreply.github.com>
  • Loading branch information
Muna-alhassan and Man-MSFT authored Oct 25, 2022
1 parent 1735d85 commit 872954e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions sdk/ml/azure-ai-ml/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- MLClient.from_config can now find the default config.json on Compute Instance when running sample notebooks.
- Registries now assign managed tags to match registry's tags.
- Adjust registry experimental tags and imports to avoid warning printouts for unrelated operations.
- Prevent registering an already existing environment that references conda file.

### Other Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ def _from_rest_object(cls, env_rest_object: EnvironmentVersionData) -> "Environm
if rest_env_version.conda_file:
translated_conda_file = yaml.safe_load(rest_env_version.conda_file)
environment.conda_file = translated_conda_file
environment._translated_conda_file = rest_env_version.conda_file

return environment

Expand Down

0 comments on commit 872954e

Please sign in to comment.