MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / locate_operation

Function locate_operation

tests/flow/execution_plan_util.py:5–15  ·  view source on GitHub ↗

Searches for a specific operation in the execution plan and returns it if found, or None otherwise

(op: Operation, name: str)

Source from the content-addressed store, hash-verified

3
4
5def locate_operation(op: Operation, name: str):
6 """Searches for a specific operation in the execution plan and returns it if
7 found, or None otherwise"""
8 if op.name == name:
9 return op
10 if op.children:
11 for child in op.children:
12 res = locate_operation(child, name)
13 if res:
14 return res
15 return None
16
17# Iterate recursively the operation's children and return the number of operations with a specific name
18def count_operation(op: Operation, name: str):

Calls

no outgoing calls