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

isaTools/Model/Comment raises ISAModelAttributeError when setting comment value with valid value #360

Closed
podonnellalidyne opened this issue Jul 15, 2020 · 2 comments
Milestone

Comments

@podonnellalidyne
Copy link

While implementing some code to set the value of a comment, we would receive an ISAModelAttributeError, even when passing in a valid string. The value is set even though the error is raised. Catching and discarding the Error allows the code to complete and function normally.

Upon inspecting the code, it appears that the @value.setter in isatools/model.py has the raise Error as the last statement of the method instead of in an else statement, as seen in @name.setter.

@value.setter
    def value(self, val):
        if isinstance(val, str):
            self.__value = val
        raise ISAModelAttributeError('Comment.value must be a string')

should be

@value.setter
    def value(self, val):
        if isinstance(val, str):
            self.__value = val
        else:
            raise ISAModelAttributeError('Comment.value must be a string')
@proccaserra
Copy link
Member

@podonnellalidyne tx for reporting.

@Zigur Zigur added this to the 0.12 milestone Jan 21, 2021
@Zigur
Copy link
Contributor

Zigur commented Jan 21, 2021

This should be solved now with commit 15f33c7

@Zigur Zigur closed this as completed Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants