-
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
Test Search API on ISIS ICAT #319
Comments
#314 will fix various issues I've noticed on /datasets and /instruments (due to ISIS having no PIDs on these entities) |
Sending the following request:
returns That same request returns data fine when I run it against my local Search API instance which points to SciGateway preprod ICAT. |
@VKTB this looks to be caused by the differences between the ICAT schema and the PaNOSC data model. By using limit and skip to target certain records, that request does work. The following request (the same as yours but has a limit of 1 and skip of 2) does work:
However, if you use a skip of 3, you get an error. Looking at my logs (I'm using my local instance pointing at ISIS dev ICAT), there's a Traceback (most recent call last):
File "/root/seg_dev/datagateway-api/datagateway_api/src/search_api/helpers.py", line 38, in wrapper_error_handling
return method(*args, **kwargs)
File "/root/seg_dev/datagateway-api/datagateway_api/src/resources/search_api_endpoints.py", line 34, in get
return get_search(entity_name, filters), 200
File "/root/seg_dev/datagateway-api/datagateway_api/src/search_api/session_handler.py", line 38, in wrapper_client_manager
return method(*args, **kwargs)
File "/root/seg_dev/datagateway-api/datagateway_api/src/search_api/helpers.py", line 104, in get_search
panosc_record = panosc_model.from_icat(icat_data, entity_relations).json(
File "/root/seg_dev/datagateway-api/datagateway_api/src/search_api/models.py", line 244, in from_icat
return super(Document, cls).from_icat(icat_data, required_related_fields)
File "/root/seg_dev/datagateway-api/datagateway_api/src/search_api/models.py", line 142, in from_icat
raise ValidationError(errors=[error_wrapper], model=cls)
pydantic.error_wrappers.ValidationError: 1 validation error for Document
datasets
field required (type=type_error) This looks as if including datasets on the document doesn't work. Or in other words, that particular document doesn't have a dataset linked to it. If you look at the ICAT schema for Investigation, the relationship between itself and dataset isn't mandatory, explaining how this can happen. I think you've tried to deal with this by adding the Response from a broken request on my instance: {
"error": {
"message": "Bad request",
"name": "BadRequestError",
"statusCode": 400
}
} Either one of us can look at improving this, it just depends on who needs more work first. |
Sending the following request (which is basically the Query datasets where the photon energy range is 880-990 eV example query):
returns The same error is returned by my local Search API instance which points to SciGateway preprod ICAT. Edit:
|
Replying to #319 (comment)@MRichards99 Thanks for looking into that. I agree, we should return a I did not realise that the Investigation entity in ICAT can have a zero or many Datasets but that will cause |
Closing this issue as we haven't heard anything back about the datasets relationship issue. As a result, we don't intend on making any changes to the data model at this stage. If we are asked to change the data model in the future, it should be a simple change to make and test. |
Description:
Once the endpoints have been finished and merged, we should probably point the search API at ISIS ICAT dev and do a bit of manual testing. Send a request for each type of endpoint (for each entity too) to check they all work. Send requests with some where and include filters to ensure conditions work and related entities return as expected.
Acceptance criteria:
The text was updated successfully, but these errors were encountered: