Skip to content

Commit

Permalink
Merge pull request #49 from Aristotle-Metadata-Enterprises/lookup
Browse files Browse the repository at this point in the history
Fixes Lookup and Substr functions
  • Loading branch information
s-i-l-k-e committed Dec 20, 2023
2 parents 8d4a944 + 4af483a commit de5eb2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions data_interrogator/aggregators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import django.db.models
import django.db.models
import django.db.models.functions
from django.db.models import functions as func
from django.db.models import Count, Min, Max, Sum, Value, Avg
Expand Down Expand Up @@ -77,7 +77,7 @@ def process_arguments(self, argument_string):
# This will ensure we have array of exactly 3 items.
# If there are 2, the appended None will be incldued - this is a substring of starting pos to the end.
# If there are 3, this is a substring of starting pos to the end position.
field, start_pos, end_pos = (field.split(',') + [None])[0:3]
field, start_pos, end_pos = (argument_string.split(',') + [None])[0:3]
return [field, start_pos, end_pos], {}


Expand Down Expand Up @@ -126,7 +126,7 @@ class ComplexLookup(InterrogatorFunction):

def process_arguments(self, argument_string):
try:
field, cond, value = field.split(',', 2)
field, cond, value = argument_string.split(',', 2)
except:
raise di_exceptions.InvalidAnnotationError("Not enough arguments - must be 3")
return [field, cond, value], {}

0 comments on commit de5eb2f

Please sign in to comment.