dataiku / dataiku/dataiku-api-client-python

get_graph() RecursionError: maximum recursion depth exceeded

Aperta
#310 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Python
Stelle
44
Fork
29
Merge medio
3h 34m
PR unite (30g)
2

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Parti da DSSProjectFlow.get_graph e dal traceback di DSSProjectFlowGraph.get_items_in_traversal_order, usando la riproduzione fornita del flusso ciclico. Verifica che get_graph venga completato per un progetto il cui dataset di output viene riutilizzato a monte, e aggiungi una copertura che dimostri che il ciclo non causa più un RecursionError.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
api
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.