-
Notifications
You must be signed in to change notification settings - Fork 4
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
Validation error for Sample pid field when ICAT value is None #324
Validation error for Sample pid field when ICAT value is None #324
Conversation
Codecov Report
@@ Coverage Diff @@
## master #324 +/- ##
=======================================
Coverage 92.62% 92.62%
=======================================
Files 43 43
Lines 3199 3215 +16
Branches 318 321 +3
=======================================
+ Hits 2963 2978 +15
Misses 198 198
- Partials 38 39 +1
Continue to review full report at Codecov.
|
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.
Looks good. Could this issue appear on the other pid
fields on other entities? I've looked at the mappings, and like Sample.pid
, all the ICAT fields are optional so the ICAT value could be None.
Co-authored-by: Matthew Richards <[email protected]>
Considering that all |
The failing test jobs will be fixed by #325 |
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 making the changes on the other entities. This was actually a problem on ISIS - they have PIDs/DOIs for documents, but not for datasets or instruments. So this change means we can actually query them without having it 500 :)
I just have a query on the returns on set_pid()
as per the comment
This PR will close #314
Description
The changes in this PR add an alternative ICAT mapping for the PaNOSC Sample
pid
field. For ISIS, thepid
values of some ICAT sample areNone
but because the PaNOSCpid
field is defined as mandatory,pydantic
throws a validation error. It was decided that whenpid
of an ICAT sample isNone
, itsid
to instead be taken and used in setting the value of the PaNOSCpid
field in thepid:<id>
format. As this is being set at the Search API level, a logic was needed to ensure that the relevant ICAT field is queried with the value in the right format when WHERE filter is applied on the PaNOSCpid
field.Testing Instructions
icatdb Generator Script Consistency Test
CI job fails, is this because of a deliberate change made to the script to change generated data (which isn't actually a problem) or is here an underlying issue with the changes made?fix:
,feat:
orBREAKING CHANGE:
so a release is automatically made via GitHub Actions upon merge?http://{{datagateway-api}}/search-api/datasets?filter={"include": [{"relation": "samples"}]}
should return all datasets with their samples