Survey banner
Share your feedback on the Dataiku documentation with this 5 min survey. Thanks! TAKE THE SURVEY

Modify the value of a variable in a Python recipe

Level 2
Modify the value of a variable in a Python recipe


I'm asking this question again, because I need an answer quickly and I'm not sure my comment in the original thread will be seen.

"I would like to modify the value of a variable that I declared in my project (Settings > Variables) in a Python recipe. Is it possible ?"


0 Kudos
2 Replies

The DSS public API allows you to do that, including via its python client: see DSSProject.set_variable. You'll need to install the python package in the DSS Python environment though.

Depending on the use case, you may find it simpler to use a Set project settings step in a Scenario, even if you have a custom python step before to compute the value.

0 Kudos
Level 5
I would appreciate an example rather than a link to a documentation, where it is quite hard to navigate and search.
0 Kudos