Skip to content

Commit 754adf8

Browse files
committed
updated issues with test cases
1 parent 2f1d661 commit 754adf8

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

ads/model/model_metadata.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1769,6 +1769,31 @@ class CustomerNotificationType(str, metaclass=ExtendedEnumMeta):
17691769
ON_FAILURE = "ON_FAILURE"
17701770
ON_SUCCESS = "ON_SUCCESS"
17711771

1772+
_value_map = {
1773+
"NONE": NONE,
1774+
"ALL": ALL,
1775+
"ON_FAILURE": ON_FAILURE,
1776+
"ON_SUCCESS": ON_SUCCESS,
1777+
}
1778+
1779+
@classmethod
1780+
def create(cls, key):
1781+
if key in cls._value_map:
1782+
return cls._value_map[key]
1783+
raise ValueError(f"Invalid CustomerNotificationType: {key}")
1784+
1785+
@classmethod
1786+
def from_string(cls, value):
1787+
for member in cls:
1788+
if member.value == value:
1789+
return member
1790+
raise ValueError(f"Invalid CustomerNotificationType: {value}")
1791+
1792+
@property
1793+
def value(self):
1794+
return str(self)
1795+
1796+
17721797

17731798
class ModelBackupSetting:
17741799
"""
@@ -1913,7 +1938,7 @@ def __repr__(self):
19131938
return self.to_yaml()
19141939

19151940

1916-
class SettingStatus(str, ExtendedEnumMeta):
1941+
class SettingStatus(str, metaclass=ExtendedEnumMeta):
19171942
"""Enum to represent the status of retention settings."""
19181943
PENDING = "PENDING"
19191944
SUCCEEDED = "SUCCEEDED"

tests/unitary/default_setup/model/test_datascience_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
ModelCustomMetadataItem,
3636
MetadataCustomCategory,
3737
ModelBackupSetting,
38-
ModelRetentionSetting
38+
ModelRetentionSetting,
3939
)
4040
from ads.model.service.oci_datascience_model import (
4141
ModelProvenanceNotFoundError,

0 commit comments

Comments
 (0)