Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProvRecord.get_attribute behaviour differs from its doc string #153

Closed
cdboer opened this issue Mar 8, 2022 · 0 comments · Fixed by #159
Closed

ProvRecord.get_attribute behaviour differs from its doc string #153

cdboer opened this issue Mar 8, 2022 · 0 comments · Fixed by #159

Comments

@cdboer
Copy link

cdboer commented Mar 8, 2022

class ProvRecord(object):
    def __init__(self, bundle, identifier, attributes=None):
        ...
        self._attributes = defaultdict(set)
        ...

    def get_attribute(self, attr_name):
        """
        Returns the attribute of the given name.
        :param attr_name: Name of the attribute.
        :return: Tuple (name, value)
        """
        attr_name = self._bundle.valid_qualified_name(attr_name)
        return self._attributes[attr_name]

The doc string implies, that get_attribute returns a tuple containing the attribute name aswell as its value.
In practice get_attribute always returns a set. Is this intended behaviour?

I was searching for a method that would return the attribute tuple or its value for a given attribute name.
I did not expect to retrieve a set.

@trungdong trungdong linked a pull request May 29, 2024 that will close this issue
trungdong added a commit that referenced this issue May 29, 2024
Fixed documentation for ProvRecord.get_attribute() #153
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants