Change connection and variable of deployment in project deployer using python API

dataikubest
Level 2
Change connection and variable of deployment in project deployer using python API

Once I create a deployment, is there a way to update 'connections' and 'variables' so that I can deploy and activate?

0 Kudos
1 Reply
Turribeach

You will be way better to add the connections mapping in your deployment settings so that all the connections will be remapped automatically by the Deployer. As for the project variables you shouldn't need to change these if you use Local variables for your Designer node and Global variables for your Automation node (since Local variables are not included in the project bundle). However if you have a multiple environment setup you can update project variables as follows:

 

import dataiku
client = dataiku.api_client()

project = client.get_project(dataiku.get_custom_variables()['projectKey'])
project_variables = project.get_variables()
project_variables['standard']['Sample_ratio'] = 0.001
project_variables = project.set_variables(project_variables)

 

0 Kudos