Commit aba1073e authored by Nsukami Patrick's avatar Nsukami Patrick
Browse files

[mypy] Improve type annotation for visit_insert & visit_delete

- `visit_insert` method should only accept rql.stmts.Insert type nodes
- `visit_delete` should only accept rql.stmts.Delete type nodes
parent 3a6b677aeceb
Pipeline #96178 passed with stages
in 1 minute and 48 seconds
......@@ -450,7 +450,7 @@ class ETypeResolver:
for select in node.children:
self._visit(select)
def visit_insert(
def _visit_insert_or_delete(
self, node: Union_["rql.stmts.Delete", "rql.stmts.Insert"]
) -> None:
if not node.defined_vars:
......@@ -471,7 +471,11 @@ class ETypeResolver:
self._visit(node.where, constraints)
self.solve(node, constraints)
visit_delete = visit_insert
def visit_insert(self, node: "rql.stmts.Insert") -> None:
return self._visit_insert_or_delete(node)
def visit_delete(self, node: "rql.stmts.Delete") -> None:
return self._visit_insert_or_delete(node)
def visit_set(self, node: "rql.stmts.Set") -> None:
if not node.defined_vars:
......
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