Create SQL (Script) Recipe via Python API with user sql query

Options
dadbuz
dadbuz Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered, Dataiku DSS Developer Posts: 16 ✭✭✭✭
edited July 16 in Using Dataiku

Hi,

What's the proper way of creating sql recipe with query programmatically through public api. I tried the bellow code but it looks like the with_script isn't working as expected - recipe is created with no code inside.

recipe_creator = project.new_recipe("sql_script", name="test")
recipe = recipe_creator.with_input(input_dataset.id).with_output(output_dataset.id).with_script(query).create()

I'm aware you can use pass in the txt to the recipe payload but hoping to be able to use the above approach so all the configurations is done before the creation.

Thanks

Answers

Setup Info
    Tags
      Help me…