Skip to content

Commit

Permalink
Merge pull request #7 from cloudblue/feature/LITE-24359
Browse files Browse the repository at this point in the history
LITE-24359 Changed class methods to object methods in BaseRQLTransformer
  • Loading branch information
maxipavlovic authored Jul 12, 2022
2 parents d13f65b + a5155ca commit 985032c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions py_rql/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@


class BaseRQLTransformer(Transformer):
@classmethod
def _extract_comparison(cls, args):
def _extract_comparison(self, args):
if len(args) == 2:
# Notation: id=1 # noqa: E800
operation = ComparisonOperators.EQ
Expand All @@ -24,20 +23,19 @@ def _extract_comparison(cls, args):

elif args[0].data == 'comp_term':
# Notation: eq(id,1) # noqa: E800
operation = cls._get_value(args[0])
operation = self._get_value(args[0])
prop_index = 1
value_index = 2

else:
# Notation: id=eq=1
operation = cls._get_value(args[1])
operation = self._get_value(args[1])
prop_index = 0
value_index = 2

return cls._get_value(args[prop_index]), operation, cls._get_value(args[value_index])
return self._get_value(args[prop_index]), operation, self._get_value(args[value_index])

@staticmethod
def _get_value(obj):
def _get_value(self, obj):
while isinstance(obj, Tree):
obj = obj.children[0]

Expand Down

0 comments on commit 985032c

Please sign in to comment.