Survey banner
Switching to Dataiku - a new area to help users who are transitioning from other tools and diving into Dataiku! CHECK IT OUT

Parse prepare recipe from Dataiku API

ZidanAA
Level 1
Parse prepare recipe from Dataiku API

Hello All !

 

i am looking to parse the prepare recipe steps in order to analyze each step separately on its ownm using DSS API, is there any way?

BR,

0 Kudos
3 Replies
Turribeach

This should be possible but why would you want to do this? What are you trying to achieve?

0 Kudos
ZidanAA
Level 1
Author

Hello Turri,

Thank you for your response!

 

We are working currently on tracking the columns names through the whole projects flow, for instance, I want to track a column name 'teacher_phone' in a dataset named 'Schools', sometime while tracking it, some analysts do a complete changes, for example, our column 'teacher_phone' maybe at some point in the flow it was named 't_mobile' but was changed by a prepare recipe.

 

Please note that we are catching any other recipe and the changes it occurs to it, unlike the prepare recipe, till now we, couldn't parse it properly.

0 Kudos

The Prepare recipe is slightly different than other recipes as it has steps. This code snippet will get you the steps but you will need further code to process the params to extract the input and output columns, where applicable. There are nearly a hundred processors and each can have different parameters so your code will need to handle that gracefully. 

 

import dataiku
client_handle = dataiku.api_client()
project_handle = client_handle.get_project('project_key')
recipe_handle = project_handle.get_recipe('recipe_id')
recipe_settings = recipe_handle.get_settings()
for step in recipe_settings.raw_steps:
    print(step)

 

 

0 Kudos