Skip to content

Commit

Permalink
#146: Add DISTINCT aggregate to all ISIS specific queries
Browse files Browse the repository at this point in the history
- Testing on dev ISIS ICAT determined this was needed
  • Loading branch information
MRichards99 committed Oct 15, 2020
1 parent e28c39b commit b52634a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/icat/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def get_facility_cycles_for_instrument(
"""
# TODO - Add logging

query_aggregate = "COUNT" if count_query else None
query_aggregate = "COUNT:DISTINCT" if count_query else "DISTINCT"
query = ICATQuery(
client, "FacilityCycle", aggregate=query_aggregate, isis_endpoint=True
)
Expand Down Expand Up @@ -558,7 +558,7 @@ def get_investigations_for_instrument_in_facility_cycle(
:type count_query: :class:`bool`
:return: A list of Investigations that match the query
"""
query_aggregate = "COUNT" if count_query else None
query_aggregate = "COUNT:DISTINCT" if count_query else "DISTINCT"
query = ICATQuery(
client, "Investigation", aggregate=query_aggregate, isis_endpoint=True
)
Expand Down

0 comments on commit b52634a

Please sign in to comment.