Skip to content

Commit

Permalink
Merge pull request #159 from trungdong/153-provrecordget_attribute
Browse files Browse the repository at this point in the history
Fixed documentation for ProvRecord.get_attribute() #153
  • Loading branch information
trungdong authored May 29, 2024
2 parents ec9d8c8 + 44d9939 commit 09af502
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 09af502

Please sign in to comment.