Commit dd36a2c8 authored by Frank Bessou's avatar Frank Bessou 🍁
Browse files

fix: move Graph to stmts and fix its definition

parent 76cd69888753
......@@ -260,9 +260,6 @@ class RQLSTChecker:
self, select: "rql.stmts.Select", fromvar: str, tovar: str
) -> bool:
graph = select.vargraph
# Argument 1 to "has_path" has incompatible
# type "Union[Dict[str, List[str]], Dict[Tuple[str, str], str], Dict[Any, Any]]";
# expected "Dict[str, List[str]]" [arg-type]
path: Optional[List[str]] = has_path(
graph, fromvar, tovar # type:ignore[arg-type]
)
......@@ -270,13 +267,10 @@ class RQLSTChecker:
return False
for var in path:
try:
# Invalid index type "Tuple[str, str]"
# for "Union[Dict[Tuple[str, str], str], Dict[str, List[str]], Dict[Any, Any]]";
# expected type "str"
rtype = graph[(fromvar, var)] # type:ignore[index]
rtype = graph[(fromvar, var)]
cardidx: int = 0
except KeyError:
rtype = graph[(var, fromvar)] # type:ignore[index]
rtype = graph[(var, fromvar)]
cardidx = 1
rschema: Any = self.schema.rschema(rtype)
for rdef in rschema.rdefs.values():
......
......@@ -57,7 +57,7 @@ SolutionsList = List[Solution]
# this is a node of the syntax tree
# used, for now, for Select.vargraph
Graph = Union_[Dict[Tuple[str, str], str], Dict[str, List[str]], Dict]
Graph = Dict[Union_[Tuple[str, str], str], List[str]]
def _check_references(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment