-
Notifications
You must be signed in to change notification settings - Fork 75
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
BUG: Fix embedded metadata elements #188
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.
A couple little things, but nothing to hold it up for.
siphon/metadata.py
Outdated
attributes = element.attrib | ||
has_xlink_title = xlink_title_attr in attributes | ||
has_xlink_href = xlink_href_attr in attributes | ||
return (has_xlink_title and has_xlink_href) |
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.
No need for parens.
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.
Cool - fixed.
cat = TDSCatalog(url) | ||
md = cat.metadata | ||
assert 'external_metadata' in md | ||
assert 'serviceName' in md |
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.
This is sufficient to prove that it's working?
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.
If the embedded metadata element is successfully parsed and understood, then the external_metadata keyword will be added to the metadata dict. If the other metadata isn't added (because the embedded metadata element does not have inherited=true, which is currently the case), then the second assert will fail.
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.
ok, works for me.
Addresses the case where a metadata element pointing to an external metadata document, via xlink, is a child of a parent metadata element. Fixes Unidata#179
01a6cfa
to
38504ed
Compare
Addresses the case where a metadata element pointing to an external metadata document, via xlink, is a child of a parent metadata element.
Fixes #179