Skip to content

Commit

Permalink
Fixed documentation for ProvRecord.get_attribute() #153
Browse files Browse the repository at this point in the history
  • Loading branch information
trungdong committed May 29, 2024
1 parent ec9d8c8 commit 44d9939
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/prov/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def __init__(self, bundle, identifier, attributes=None):
"""
self._bundle = bundle
self._identifier = identifier
self._attributes = defaultdict(set)
self._attributes: dict[QualifiedName, set] = defaultdict(set)
if attributes:
self.add_attributes(attributes)

Expand Down Expand Up @@ -273,12 +273,13 @@ def add_asserted_type(self, type_identifier):
"""
self._attributes[PROV_TYPE].add(type_identifier)

def get_attribute(self, attr_name):
def get_attribute(self, attr_name) -> set:
"""
Returns the attribute of the given name.
:param attr_name: Name of the attribute.
:return: Tuple (name, value)
:return: Set of value(s) of the specified attribute.
:rtype: set
"""
attr_name = self._bundle.valid_qualified_name(attr_name)
return self._attributes[attr_name]
Expand Down

0 comments on commit 44d9939

Please sign in to comment.