Skip to content
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

Make Distinct Field Filters Apply Correctly on ISIS Endpoints #176

Merged

Conversation

MRichards99
Copy link
Collaborator

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 in ICATQuery with an if statement:
if distinct_attributes != []:

This ensures mapped_distinct_fields is always None on an ISIS specific endpoint (where a query aggregate of DISTINCT is required) but no distinct field filter is used. This then prevents the issue before isis_endpoint was implemented (a list of empty dictionaries as the response body). Removal of isis_endpoint means that when a distinct filter is used, code relating to that will be executed (and not blocked by and 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"

Copy link
Member

@louise-davies louise-davies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the issues I had with the other PR and it's working nicely (insofar as distinct filters work right now - perhaps I should rereview once distinct filters are fixed? although I doubt it will affect these changes)

@MRichards99 MRichards99 merged commit eadd9fc into feature/improve-logging-icat-backend-#164 Nov 20, 2020
@MRichards99 MRichards99 deleted the test-existing-bug-issues branch November 20, 2020 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Distinct filter not correctly applied to ISIS endpoints
2 participants