azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

ComputeInstance "created_on" attribute is empty

Open masgra opened this issue 2 years ago • 4 comments

Type of issue

Code doesn't work

Description

ComputeInstance.created_on is always empty, even though the value can be retrieved via sdk_v1.

Example with sdk v2:

# get a handle to the workspace
from azure.ai.ml import MLClient
from azure.identity import DefaultAzureCredential
from azure.ai.ml.entities import ComputeInstance, AmlCompute

ml_client = MLClient.from_config(credential=DefaultAzureCredential())

# get compute instance by name 
ci_handler = ml_client.compute.get('delete-me')

print(ci_handler.created_on)

>> None

Example old sdk v1:

from azureml.core import Workspace, ComputeTarget

ws = Workspace.from_config()
compute_list = ComputeTarget.list(ws)

compute_name = "delete-me"
compute_instance = next((c for c in compute_list if c.name == compute_name), None)
print(compute_instance.created_on)

>> 2024-01-19 10:55:01.722176+00:00

Page URL

https://learn.microsoft.com/en-us/python/api/azure-ai-ml/azure.ai.ml.entities.computeinstance?view=azure-python

Content source URL

https://github.com/MicrosoftDocs/azure-docs-sdk-python/blob/main/docs-ref-autogen/azure-ai-ml/azure.ai.ml.entities.ComputeInstance.yml

Document Version Independent Id

7ab02ac5-652c-6123-d71c-e5fd6ea6277b

Article author

@lmazuel

Metadata

  • ID: 48a9ae21-e8f7-7919-ec01-9355d0b200c8
  • Service: machine-learning

masgra avatar Jan 19 '24 12:01 masgra

Thank you for the feedback @masgra . We will investigate and get back to you asap.

cc @azureml-github

kashifkhan avatar Jan 19 '24 14:01 kashifkhan

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/azure-ml-sdk @azureml-github.

github-actions[bot] avatar Jan 19 '24 14:01 github-actions[bot]

Hi @masgra , thank you for bringing this to our attention. There is a fix for this bug coming in the Feburary SDK v2 release.

nemanjarajic avatar Jan 19 '24 22:01 nemanjarajic

https://github.com/Azure/azure-sdk-for-python/pull/33661

nemanjarajic avatar Jan 30 '24 23:01 nemanjarajic