Bring more happyness to mypy
This commit is contained in:
parent
f7f51b3413
commit
6fcb5ecb85
@ -34,7 +34,7 @@ from typing import Tuple, Dict, List
|
|||||||
|
|
||||||
from relational.relation import Relation
|
from relational.relation import Relation
|
||||||
from relational import parser
|
from relational import parser
|
||||||
from relational.parser import Binary, Unary, PRODUCT, \
|
from relational.parser import Binary, Unary, Node, PRODUCT, \
|
||||||
DIFFERENCE, UNION, INTERSECTION, DIVISION, JOIN, \
|
DIFFERENCE, UNION, INTERSECTION, DIVISION, JOIN, \
|
||||||
JOIN_LEFT, JOIN_RIGHT, JOIN_FULL, PROJECTION, \
|
JOIN_LEFT, JOIN_RIGHT, JOIN_FULL, PROJECTION, \
|
||||||
SELECTION, RENAME, ARROW
|
SELECTION, RENAME, ARROW
|
||||||
@ -468,8 +468,8 @@ def selection_and_product(n: parser.Node, rels: Dict[str, Relation]) -> Tuple[pa
|
|||||||
r_attr = n.child.right.result_format(rels)
|
r_attr = n.child.right.result_format(rels)
|
||||||
|
|
||||||
tokens = tokenize_select(n.prop)
|
tokens = tokenize_select(n.prop)
|
||||||
groups = []
|
groups: List[List[LevelString]] = []
|
||||||
temp = []
|
temp: List[LevelString] = []
|
||||||
|
|
||||||
for i in tokens:
|
for i in tokens:
|
||||||
if i == 'and' and i.level == 0:
|
if i == 'and' and i.level == 0:
|
||||||
@ -477,9 +477,9 @@ def selection_and_product(n: parser.Node, rels: Dict[str, Relation]) -> Tuple[pa
|
|||||||
temp = []
|
temp = []
|
||||||
else:
|
else:
|
||||||
temp.append(i)
|
temp.append(i)
|
||||||
if len(temp) != 0:
|
if len(temp):
|
||||||
groups.append(temp)
|
groups.append(temp)
|
||||||
temp = []
|
del temp
|
||||||
|
|
||||||
left = []
|
left = []
|
||||||
right = []
|
right = []
|
||||||
@ -508,7 +508,7 @@ def selection_and_product(n: parser.Node, rels: Dict[str, Relation]) -> Tuple[pa
|
|||||||
l_prop = ' and '.join((' '.join(i) for i in left))
|
l_prop = ' and '.join((' '.join(i) for i in left))
|
||||||
if '(' in l_prop:
|
if '(' in l_prop:
|
||||||
l_prop = '(%s)' % l_prop
|
l_prop = '(%s)' % l_prop
|
||||||
l_node = Unary(SELECTION, l_prop, n.child.left)
|
l_node: Node = Unary(SELECTION, l_prop, n.child.left)
|
||||||
else:
|
else:
|
||||||
l_node = n.child.left
|
l_node = n.child.left
|
||||||
|
|
||||||
@ -517,7 +517,7 @@ def selection_and_product(n: parser.Node, rels: Dict[str, Relation]) -> Tuple[pa
|
|||||||
r_prop = ' and '.join((' '.join(i) for i in right))
|
r_prop = ' and '.join((' '.join(i) for i in right))
|
||||||
if '(' in r_prop:
|
if '(' in r_prop:
|
||||||
r_prop = '(%s)' % r_prop
|
r_prop = '(%s)' % r_prop
|
||||||
r_node = Unary(SELECTION, r_prop, n.child.right)
|
r_node: Node = Unary(SELECTION, r_prop, n.child.right)
|
||||||
else:
|
else:
|
||||||
r_node = n.child.right
|
r_node = n.child.right
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user