Make Distinct Field Filters Apply Correctly on ISIS Endpoints #176
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR will close #114.
This branch was initially just meant for testing all the existing issues with the bug label, but I noticed #114 didn't work properly on the new backend so I fixed it on this branch.
I've fixed this by replacing the
isis_endpoint
parameter inICATQuery
with an if statement:if distinct_attributes != []:
This ensures
mapped_distinct_fields
is alwaysNone
on an ISIS specific endpoint (where a query aggregate ofDISTINCT
is required) but no distinct field filter is used. This then prevents the issue beforeisis_endpoint
was implemented (a list of empty dictionaries as the response body). Removal ofisis_endpoint
means that when a distinct filter is used, code relating to that will be executed (and not blocked byand not self.isis_endpoint
). Ordinary endpoints still work as they should.On the ISIS dev ICAT, this request served as a good test:
http://{{datagateway-api}}/instruments/23/facilitycycles/84762458/investigations?distinct="id"