Set a project level variable from a python recipe

Tomas
Tomas Registered, Neuron 2022 Posts: 121 ✭✭✭✭✭
Hi,

I need to set a project level variable from a python recipe. How can I do that? I dont want to use Scenario in this case.

Thanks for the example,

Tomas

Best Answer

Answers

  • taraku
    taraku Dataiker, Alpha Tester, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Registered Posts: 53 Dataiker

    Thanks @Marlan
    for showing how the default project key works! - I was able to use the "default project key" in my Custom Python step in a Scenario. Now I can make copies of my project and run the scenario without having to update the formerly hard-coded project key!


    # obtain a handle on the instance and default project key
    client = dataiku.api_client()
    project = dataiku.api_client().get_project(dataiku.default_project_key())

    vs. hard-coded:

    # obtain a handle on your instance and project

    client = dataiku.api_client()

    project = client.get_project('variables102final')

Setup Info
    Tags
      Help me…