Skip to content

Commit

Permalink
remove unused method _missing method in enum.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tilen1976 committed Aug 15, 2024
1 parent 6dd585a commit f0ad72f
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/datadoc/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@ def __init__(
self._value_ = self.name
self.language_strings = language_strings

# TODO(@tilen1976: remove?) # noqa: TD004, TD003
@classmethod
def _missing_(cls, value: object) -> LanguageStringsEnum:
"""Support constructing an enum member from a supplied name string."""
try:
member: LanguageStringsEnum = cls._member_map_[str(value)] # type: ignore [assignment]
except KeyError as e:
# Raise the expected exception with a useful explanation
message = f"{value} is not a valid {cls.__qualname__}"
raise ValueError(message) from e
else:
return member

def get_value_for_language(
self,
language: enums.SupportedLanguages,
Expand Down

0 comments on commit f0ad72f

Please sign in to comment.