Skip to content

Commit ec81346

Browse files
committed
Remove warning for Enum member usage in ChoiceItem initialization
(warning was shown when setting defaults, even if they were initialized to Enum members (due to the internal string representation)
1 parent 8b94994 commit ec81346

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

guidata/dataset/dataitems.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -976,11 +976,6 @@ def _enum_coerce_in(self, v: Any) -> str:
976976
if self._enum_cls is not None:
977977
if isinstance(v, self._enum_cls):
978978
return v.name
979-
warnings.warn(
980-
"When a ChoiceItem is created with an Enum, using its members for "
981-
"default and assigned values is the recommended usage.",
982-
UserWarning,
983-
)
984979
# name
985980
if isinstance(v, str) and v in self._enum_cls.__members__:
986981
return v

0 commit comments

Comments
 (0)