Skip to content

Commit

Permalink
move string conversion to __str__() #259
Browse files Browse the repository at this point in the history
- This means when the input is of type `SearchAPIWhereFilter`, it won't execute Python ICAT code until the filter needs to be applied/processed
  • Loading branch information
MRichards99 committed Dec 2, 2021
1 parent 60c3bad commit 0c4f9ac
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions datagateway_api/src/search_api/nested_where_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ def __init__(self, lhs, rhs, joining_operator):
:type joining_operator: :class:`str`
"""

self.lhs = str(lhs)
self.rhs = str(rhs)
self.joining_operator = joining_operator
self.lhs = lhs
self.rhs = rhs

def __str__(self):
"""
Join the condition on the left with the one on the right with the boolean
operator
"""
return f"({self.lhs} {self.joining_operator} {self.rhs})"
return f"({str(self.lhs)} {self.joining_operator} {str(self.rhs)})"

0 comments on commit 0c4f9ac

Please sign in to comment.