Skip to content

Commit

Permalink
#114: Remove isis_endpoint attribute from ICATQuery
Browse files Browse the repository at this point in the history
- Due to the previous commit there is now no need for this parameter
  • Loading branch information
MRichards99 committed Oct 19, 2020
1 parent 5e19893 commit c9e80c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
4 changes: 2 additions & 2 deletions common/icat/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def get_facility_cycles_for_instrument(

query_aggregate = "COUNT:DISTINCT" if count_query else "DISTINCT"
query = ICATQuery(
client, "FacilityCycle", aggregate=query_aggregate, isis_endpoint=True
client, "FacilityCycle", aggregate=query_aggregate
)

instrument_id_check = PythonICATWhereFilter(
Expand Down Expand Up @@ -573,7 +573,7 @@ def get_investigations_for_instrument_in_facility_cycle(

query_aggregate = "COUNT:DISTINCT" if count_query else "DISTINCT"
query = ICATQuery(
client, "Investigation", aggregate=query_aggregate, isis_endpoint=True
client, "Investigation", aggregate=query_aggregate
)

instrument_id_check = PythonICATWhereFilter(
Expand Down
9 changes: 0 additions & 9 deletions common/icat/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def __init__(
conditions=None,
aggregate=None,
includes=None,
isis_endpoint=False,
):
"""
Create a Query object within Python ICAT
Expand All @@ -39,12 +38,6 @@ def __init__(
:param includes: List of related entity names to add to the query so related
entities (and their data) can be returned with the query result
:type includes: :class:`str` or iterable of :class:`str`
:param isis_endpoint: Flag to determine if the instance will be used for an ISIS
specific endpoint. These endpoints require the use of the DISTINCT aggregate
which is different to the distinct field filter implemented in this API, so
this flag prevents code related to the filter from executing (because it
doesn't need to be on a DISTINCT aggregate)
:type isis_endpoint: :class:`bool`
:return: Query object from Python ICAT
:raises PythonICATError: If a ValueError is raised when creating a Query(), 500
will be returned as a response
Expand All @@ -65,7 +58,6 @@ def __init__(
" suggesting an invalid argument"
)

self.isis_endpoint = isis_endpoint

def execute_query(self, client, return_json_formattable=False):
"""
Expand Down Expand Up @@ -104,7 +96,6 @@ def execute_query(self, client, return_json_formattable=False):
if (
self.query.aggregate == "DISTINCT"
and not count_query
#and not self.isis_endpoint
):
log.info("Extracting the distinct fields from query's conditions")
# Check query's conditions for the ones created by the distinct filter
Expand Down

0 comments on commit c9e80c0

Please sign in to comment.