File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,11 @@ def _create_operation(args):
164164 if op_level == level :
165165 # if the operation level equal to the current level
166166 # set the current operation and move next
167- current = _create_operation (current_op .split ("|" ))
167+ child = _create_operation (current_op .split ("|" ))
168+ if current :
169+ current = stack .pop ()
170+ current .append_child (child )
171+ current = child
168172 i += 1
169173 elif op_level == level + 1 :
170174 # if the operation is child of the current operation
Original file line number Diff line number Diff line change @@ -325,6 +325,25 @@ def test_explain(self):
325325
326326 self .assertEqual (result .structured_plan , expected )
327327
328+ result = redis_graph .explain ("""MATCH (r:Rider), (t:Team)
329+ RETURN r.name, t.name""" )
330+ expected = '''\
331+ Results
332+ Project
333+ Cartesian Product
334+ Node By Label Scan | (r:Rider)
335+ Node By Label Scan | (t:Team)'''
336+ self .assertEqual (str (result ), expected )
337+
338+ expected = Operation ('Results' ) \
339+ .append_child (Operation ('Project' )
340+ .append_child (Operation ('Cartesian Product' )
341+ .append_child (Operation ('Node By Label Scan' ))
342+ .append_child (Operation ('Node By Label Scan' ))
343+ ))
344+
345+ self .assertEqual (result .structured_plan , expected )
346+
328347 redis_graph .delete ()
329348
330349 def test_profile (self ):
You can’t perform that action at this time.
0 commit comments