Skip to content

Commit

Permalink
Fix type annotation and description
Browse files Browse the repository at this point in the history
for field_from_path method
  • Loading branch information
gregorjerse committed Dec 12, 2023
1 parent f0e3fc3 commit 88379bb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions resolwe/flow/models/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,11 @@ def id_from_path(cls, path: str) -> Optional[int]:
)

@classmethod
def field_from_path(cls, path: str) -> Optional["AnnotationField"]:
"""Get the field id from the field path."""
def field_from_path(cls, path: str) -> "AnnotationField":
"""Get the field id from the field path.
:raises ValidationError: when field does not exist.
"""
group_name, field_name = cls.group_field_from_path(path)
field = cls.objects.filter(group__name=group_name, name=field_name).first()
if not field:
Expand Down

0 comments on commit 88379bb

Please sign in to comment.