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

dataikubest Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 8

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


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

    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)

Setup Info
      Help me…