Community Conundrum 28: News Engagement is live! Read More

Error in dataiku API

Level 2
Level 2
Error in dataiku API

Hi, 

There is an error is Dataiku's API in the recipe module. 

When we have to set a code env, it isn't the name passed as an argument but the name of the argument as a string ('code_env'). 

Best regards,

Steven 

 

0 Kudos
1 Reply
Level 2
Level 2
Author

The solution I've used meanwhile a fix is out :

import dataiku
project = dataiku.api_client(dataiku.get_custom_variables()['projectKey'])
recipe = project.get_recipe('pyspark_recipe_create') # get our recipe
settings = recipe.get_settings()
settings.recipe_settings['params']['envSelection'] = {"envName": "code_env_name", "envMode": "EXPLICIT_ENV"}
settings.get_code_env_settings() # just to check if it is correctly set
settings.save() # save the edit settings = recipe.get_settings()

Steven

A banner prompting to get Dataiku DSS