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!
I'm using python code to update variables from a dataset within an Application. When the python code runs it is updating the Global variables by default. Is there a way to specify for python to update the Local Variables and not the Global Variables?
Try using dataiku's client api:
import dataiku
client = dataiku.api_client()
project = client.get_default_project()
# retrieve your project variables in a json which two first keys are 'standard' (which contains your project global variables) and 'local' (which contains your project local variables)
project_variables = project.get_variables()
my_local_variable_value = "foo"
project_variables['local']["my_local_variable"] = my_local_variable_value
project.set_variables(project_variables)
Try using dataiku's client api:
import dataiku
client = dataiku.api_client()
project = client.get_default_project()
# retrieve your project variables in a json which two first keys are 'standard' (which contains your project global variables) and 'local' (which contains your project local variables)
project_variables = project.get_variables()
my_local_variable_value = "foo"
project_variables['local']["my_local_variable"] = my_local_variable_value
project.set_variables(project_variables)
I've not seen the 'standard' vs 'local' documented anywhere else. This was exactly what I needed. Thank you!!