Parse prepare recipe from Dataiku API

Zidan
Zidan Registered Posts: 4 ✭✭

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,

Answers

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,124 Neuron

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

  • Zidan
    Zidan Registered Posts: 4 ✭✭

    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.

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,124 Neuron
    edited July 17

    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)

Setup Info
    Tags
      Help me…