Skip to content

Commit 4662dce

Browse files
authored
populate create on (#33661)
1 parent c8a4725 commit 4662dce

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute_instance.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ def _load_from_rest(cls, rest_obj: ComputeResource) -> "ComputeInstance":
401401
custom_applications = []
402402
for app in prop.properties.custom_services:
403403
custom_applications.append(CustomApplications._from_rest_object(app))
404-
405404
response = ComputeInstance(
406405
name=rest_obj.name,
407406
id=rest_obj.id,
@@ -421,7 +420,9 @@ def _load_from_rest(cls, rest_obj: ComputeResource) -> "ComputeInstance":
421420
services=[app.as_dict() for app in prop.properties.applications]
422421
if prop.properties and prop.properties.applications
423422
else None,
424-
created_on=prop.additional_properties.get("createdOn", None),
423+
created_on=rest_obj.properties.created_on.strftime("%Y-%m-%dT%H:%M:%S.%f%z")
424+
if rest_obj.properties and rest_obj.properties.created_on is not None
425+
else None,
425426
create_on_behalf_of=create_on_behalf_of,
426427
network_settings=network_settings,
427428
ssh_settings=ssh_settings,

0 commit comments

Comments
 (0)