-
Notifications
You must be signed in to change notification settings - Fork 42
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
Update links resources #306
Conversation
This has now been implemented in the specification through Materials-Consortia/OPTIMADE#273. This PR should align itself with the spec PR and as soon as the providers repository has been updated accordingly, this PR is ready. Edit: Currently waiting for the providers PR Materials-Consortia/providers#34 |
Ah, maybe this is why the resources started returning plain dicts instead of python objects with attributes in the tests I am adding in Materials-Consortia/providers#34? When this is merged, will dictionary key access continue working or I should change back the test code? |
Right, yeah! So we have ourselves a circular dependency issue here.
I've just tested this. No, unfortunately not. Maybe I should not have closed Materials-Consortia/providers#37 after all? |
I see. I guess that anyway the ultimate solution is to pin the version of the python tools in the tests. Feel free to reopen Materials-Consortia/providers#37 and we merge that first (note my comment on one missing link_type in there) |
Fix type to "links". Add `link_type` property with the Literals: "child", "root", "external", "provider"
Tests will fail until provider.optimade.org is updated with the new links resource definition.
0c8d838
to
a84987d
Compare
Codecov Report
@@ Coverage Diff @@
## master #306 +/- ##
==========================================
- Coverage 90.12% 90.11% -0.01%
==========================================
Files 55 55
Lines 2289 2287 -2
==========================================
- Hits 2063 2061 -2
Misses 226 226
Continue to review full report at Codecov.
|
Can anyone tell me why the OpenAPI CI check fails for these changes? |
Equally perplexed by the OpenAPI JSON. I don't like how much of a circular dependency we have. In the future we should: |
Doing some local testing it seems the checker fails if using |
What do you mean exactly with "version" in 2)? We have been testing pulling the list of providers always, albeit implicitly. |
Co-Authored-By: Matthew Evans <me388@cam.ac.uk>
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.
🥇
Fixes #299
This PR implements the upcoming changes to the
LinksResource
, updating the OpenAPIs from the pydantic models as well as the related tests.ChildResource
,ParentResource
, andProviderResource
has all been removed. They were not used in any case, and the newlink_type
has gotten theLiteral
type to "validate" the value.Note: This PR will fail until providers.optimade.org updates their links resources to the new schema, and changes may still occur, since the update has not yet been merged into the OPTIMADE API specification.