dataiku / dataiku/dataiku-api-client-python

get_graph() RecursionError: maximum recursion depth exceeded

Open
#310 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
44
Forks
29
Avg merge
3h 34m
Merged PRs (30d)
2

Description

my conf:
ubuntu v 22. lts
Dataiku On Premise v 13.1.2

Exemple

The get_graph method in the DSSProjectFlow class does not support flows that have loops, causing a RecursionError when trying to get the flow graph for such projects.

function's reference : https://developer.dataiku.com/latest/api-reference/python/flow.html#dataikuapi.dss.flow.DSSProjectFlow.get_graph

Steps to Reproduce
  1. Create a project in Dataiku where a recipe has a dataset as output (last stage in the flow) but used as input of another recipe. Both input and output, forming a loop.
  2. Use the API to get the flow graph:
    import dataiku
    
    client = dataiku.api_client()
    project = client.get_project("YOUR_PROJECT_KEY")
    flow = project.get_flow()
    graph = flow.get_graph()  # This line causes the RecursionError below
    
    

DSSProjectFlowGraph.get_items_in_traversal_order..add_from(graph_node)
776 predecessor_node = self.nodes[predecessor_ref]
777 if not in_set(predecessor_node):
--> 778 add_from(predecessor_node)
780 # Then add ourselves
781 if not in_set(graph_node):

DSSProjectFlowGraph.get_items_in_traversal_order..add_from(graph_node)
775 for predecessor_ref in graph_node["predecessors"]:
776 predecessor_node = self.nodes[predecessor_ref]
--> 777 if not in_set(predecessor_node):
778 add_from(predecessor_node)
780 # Then add ourselves

DSSProjectFlowGraph.get_items_in_traversal_order..in_set(obj)
767 def in_set(obj):
768 for candidate in ret:
--> 769 if candidate["type"] == obj["type"] and candidate["ref"] == obj["ref"]:
770 return True
771 return False

RecursionError: maximum recursion depth exceeded in comparison

As a result, flows using data to rewrite the same directory become problematic only in certain cases
output dataset > used as intermediate dataset of a recipe upstream of this output dataset.
but not problematic in other cases, such as;
input folder > used as output folder at the end of the flow.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at DSSProjectFlow.get_graph and the DSSProjectFlowGraph.get_items_in_traversal_order traceback, using the provided looped-flow reproduction. Verify that get_graph completes for a project whose output dataset is reused upstream, and add coverage showing the loop no longer causes a RecursionError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.