dataiku / dataiku/dataiku-api-client-python

get_graph() RecursionError: maximum recursion depth exceeded

未关闭
#310 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
44
派生
29
平均合并
3 小时 34 分钟
30 天内合并 PR
2

描述

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.

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 DSSProjectFlow.get_graph 和 DSSProjectFlowGraph.get_items_in_traversal_order traceback 入手,使用提供的循环流复现。验证对于输出数据集在上游被重复使用的项目,get_graph 能够完成,并添加覆盖测试以表明该循环不再导致 RecursionError。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
api
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。