Run a scenario within a scenario

yazidsaissi
yazidsaissi Registered Posts: 6

Hi,

I have a scenario that run my flow for a single day and I want to create another scenario that run it for multiple days using a python script.

For example:

Scenario 1 run for day 1

I want to create another scenario like:

while i >= start_date and i <= end_date:

Run Scenario 1 for day i

Does anyone has an idea about how to do it ?

Thanks

Answers

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

    Running a scenario it's easy:

    client = dataiku.api_client()
    client.get_project("project_key")
    scenario = project.get_scenario("scenario_id")
    scenario.run_and_wait()

    In terms of your date it depends on how you are going to pass it, so you will need to give us more information to understand how it is being handled.

  • yazidsaissi
    yazidsaissi Registered Posts: 6

    Thanks for the answer.

    For the date, it's global variable.

    At the beginning of my flow, I have a SQL recipe, where I'm filtering my table using the date varibale (the query is like select * from table where date = '${date}') and at the end of my flow, I append the results in a dataset.

    Now instead a having just one date variable, I will have a start and end date variables, and I want to run the precious scenario for each day between the 2 dates and then append the results to the final table.

    I hope i was clear.

    Thanks

Setup Info
    Tags
      Help me…