Reuse code for optimizations
This commit is contained in:
parent
8fd2db12b5
commit
3056dafbff
@ -150,7 +150,7 @@ class Node:
|
||||
elif isinstance(self, Binary) and self.name == DIVISION:
|
||||
return list(set(self.left.result_format(rels)) - set(self.right.result_format(rels)))
|
||||
elif self.name == PROJECTION:
|
||||
return [i.strip() for i in self.prop.split(',')]
|
||||
return self.get_projection_prop()
|
||||
elif self.name == PRODUCT:
|
||||
return self.left.result_format(rels) + self.right.result_format(rels)
|
||||
elif self.name == SELECTION:
|
||||
@ -270,8 +270,6 @@ class Unary(Node):
|
||||
self.prop = ','.join(f'{k}{ARROW}{v}' for k, v in renames.items())
|
||||
|
||||
|
||||
|
||||
|
||||
def parse_tokens(expression: List[Union[list, str]]) -> Node:
|
||||
'''Generates the tree from the tokenized expression
|
||||
If no expression is specified then it will create an empty node'''
|
||||
|
Loading…
x
Reference in New Issue
Block a user