Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hi,
does anybody has an experience with creating plugin recipes using PythonAPI?
According to the docs many different types of recipes can be created using Builder classes but cannot find plugin there.
https://doc.dataiku.com/dss/latest/python-api/recipes.html
Created manually the recipe and then tried to create a new recipe with the same type, but this approach does not work
builder = prj.new_recipe("CustomCode_csv-exporter")
! fails here, builder is None
builder.with_input("abt_dataset")
builder.with_output("5CHNNNwg")
builder.create()
import dataiku
client = dataiku.api_client()
project = client.get_default_project()
from dataikuapi.dss.recipe import SingleOutputRecipeCreator
class MyRecipeCreator(SingleOutputRecipeCreator):
def __init__(self, name, project):
SingleOutputRecipeCreator.__init__(self, "CustomCode_to-excel", name, project) #replace recipe type with yours
builder = MyRecipeCreator('my_new_custom_recipe_1', project)
recipe = builder.build()
settings = recipe.get_settings()
settings.add_input(role="input_dataset",ref="us_50")
settings.add_output(role="folder",ref="YdXfMUzM")
settings.save()
Best,
Vitaliy
import dataiku
client = dataiku.api_client()
project = client.get_default_project()
from dataikuapi.dss.recipe import SingleOutputRecipeCreator
class MyRecipeCreator(SingleOutputRecipeCreator):
def __init__(self, name, project):
SingleOutputRecipeCreator.__init__(self, "CustomCode_to-excel", name, project) #replace recipe type with yours
builder = MyRecipeCreator('my_new_custom_recipe_1', project)
recipe = builder.build()
settings = recipe.get_settings()
settings.add_input(role="input_dataset",ref="us_50")
settings.add_output(role="folder",ref="YdXfMUzM")
settings.save()
Best,
Vitaliy