Update a Jupyter notebook as a Scenario Step

VFL
VFL Registered Posts: 11 ✭✭✭
edited July 16 in Using Dataiku

Hi,

I am creating a Dataiku Application and part of the pipeline includes the Running of a Notebook, as a Scenario step.

As such a "Run a Notebook" step is not available in Scenarios, I was thinking that maybe I could use the "Execute python code" step and a code like the following, but with a Notebook instead of a Recipe.

project = client.get_project('MY_PROJECT')
recipe = project.get_recipe("my_recipe") ##### MY NOTEBOOK INSTEAD
recipe.run()

Thanks

Best Answer

  • Ignacio_Toledo
    Ignacio_Toledo Dataiku DSS Core Designer, Dataiku DSS Core Concepts, Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Frontrunner 2022 Finalist, Frontrunner 2022 Winner, Dataiku Frontrunner Awards 2021 Participant, Frontrunner 2022 Participant, Neuron 2023 Posts: 415 Neuron
    Answer ✓

    Hi @VFL
    ,

    Did you check the step called "Export Notebook"?

    Screenshot 2021-11-12 221233.png

    While the main goal of this step is to create an "Export" of a notebook, so it can be presented as a report, you can still use it to run the Notebook, even if you don't need the export.

    Hope this helps,

    Ignacio

Answers

  • RoyE
    RoyE Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 31 Dataiker

    Hi,

    There are two options that you can try to complete this workflow.

    • The first would be to simply copy the code from your notebook to the "Execute Python" step in your scenario and let the scenario run the code instead of the notebook.
    • Second, you could "Create Recipe" from the notebook and add arbitrary inputs/outputs and use the code that you provided to simply run the "recipe" but is just the contents of your notebook.

    Roy

Setup Info
    Tags
      Help me…