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!
Hi ,
We are working with access global variables and using that to do some operation and want to write it back to local variables of the project but keep the global variable untouched. set_variables do not have option to differentiate between global and local and thus creating an issue by overwriting both and messing up the json structure, same for update variables. Do we have a elegant solution to this ?
Hi,
You should be able to set global project variables ( standard) and local project variables.
Please see the below sample :
import dataiku
project = dataiku.api_client().get_project(dataiku.default_project_key())
vars = project.get_variables()
#set global variables
vars['standard']['variable_name'] = "global_variable"
#set local variables
vars['local']['variable_name'] = "local_variables"
project.set_variables(vars)
Thanks