-
Notifications
You must be signed in to change notification settings - Fork 122
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
Create valid dict without root href #896
Conversation
|
Codecov ReportBase: 94.37% // Head: 94.37% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #896 +/- ##
=======================================
Coverage 94.37% 94.37%
=======================================
Files 83 83
Lines 12015 12026 +11
Branches 1136 1137 +1
=======================================
+ Hits 11339 11350 +11
Misses 496 496
Partials 180 180
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Catalogs and Collections always have a root href. If the root Catalog or Collection (e.g. itself) does not have a self href, the dictionary serialization included a root link with href set to `null`, which is invalid. This fix removes the root link if it doesn't have a valid href. Not required for items because they don't have a root link by default. I discovered this problem when trying to write-then-read a very simple Collection using `save_object`, but the problem proved to be in the dict serialization.
a9fe18c
to
7dca7a7
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.
I think the changes address #183 from a practical standpoint. The creation of null href root links seems embedded in pystac (editing catalog.py
such that a root link that will have a null href is not created causes multiple test failures).
Yup, I found the same thing -- PySTAC kind of expects a |
Related issues:
Description:
Catalogs and Collections always have a root href. If the root Catalog or Collection (e.g. itself) does not have a self href, the dictionary serialization included a root link with href set to
null
, which is invalid. This fix removes the root link if it doesn't have a valid href.Not required for items because they don't have a root link by default.
I discovered this problem when trying to write-then-read a very simple Collection using
save_object
, but the problem proved to be in the dict serialization.PR Checklist:
pre-commit run --all-files
)scripts/test
)[ ] Documentation has been updated to reflect changes, if applicable