-
Notifications
You must be signed in to change notification settings - Fork 135
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
[issue-650] raise ParsingError if elements don't have an SPDXID #652
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix, I have a couple of questions, though.
@@ -140,7 +140,7 @@ def get_value_from_graph( | |||
# this is a helper method to cast some rdf types from graph.value() to be compatible with the | |||
# code that follows | |||
value = graph.value(subject=subject, predicate=predicate, object=_object, default=default, any=_any) | |||
if value and not isinstance(value, (URIRef, Literal, BNode)): | |||
if value != _any and value and not isinstance(value, (URIRef, Literal, BNode)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get the value != _any
part here. _any
is a bool, why should it be equal to value
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sorry, mixed the values here. This needs to be value != default
. While working on this I noticed that an error about wrong types would be logged if a package
has no files_analyzed
field. This is as the changes you commented below not related to the origin issue and rather a fix for the wrapper methods introduced with #563. Shall I create a separate PR for these changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please do :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#653
The PR should be merged first as the test in this PR fails without these changes.
492af03
to
ecdd0d1
Compare
Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
ecdd0d1
to
0f41ee0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! :)
fixes #650