Skip to content

Commit 6082463

Browse files
committed
Added warning to the Tool class when the user uses the attributes property
1 parent acf4f18 commit 6082463

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

libs/labelbox/src/labelbox/schema/ontology.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
map_tool_type_to_tool_cls,
2727
)
2828
from labelbox.schema.tool_building.types import FeatureSchemaAttributes
29+
import warnings
2930

3031

3132
class DeleteFeatureFromOntologyResult:
@@ -99,6 +100,12 @@ class Type(Enum):
99100
feature_schema_id: Optional[str] = None
100101
attributes: Optional[FeatureSchemaAttributes] = None
101102

103+
def __post_init__(self):
104+
if self.attributes is not None:
105+
warnings.warn(
106+
"Attributes are an experimental feature and may change in the future."
107+
)
108+
102109
@classmethod
103110
def from_dict(cls, dictionary: Dict[str, Any]) -> Dict[str, Any]:
104111
return cls(

0 commit comments

Comments
 (0)