Renaming recipes via Dataiku API
Hello, I am trying to rename some recipes via the API (as opposed to by hand as we want to rename quite a lot).
This is the code I am trying to run:project = client.get_project(project_key)
recipe_object = project.get_recipe(recipe_name)
recipe_object.rename('the new name')
Trying to run this gives the following error however:AttributeError: 'DSSRecipe' object has no attribute 'rename'
I'm confused to see this as the documentation states there actually is supposed to be this functionality. Is there something wrong with my code? The error does seem to indicate that I'm using the correct object class. Or has this function been removed? If the latter, is there an updated documentation of the API available anywhere?
Best Answer
-
Hi @SanderVW,
The
rename
method was added in DSS 12.5.0, as mentioned in our release notes:Added APIs to rename datasets and recipes
Are you using an older DSS version?
Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,160 Neuron
Be careful when you check the API documentation as the Developer site defaults to always show you the "Latest" documentation which only applies to the latest release. You can however navigate to a specific version documentation by changing the URL. For instance for v13 you can use:
For v12:
For v11 you need to navigate to the old site:
https://doc.dataiku.com/dss/11.0/python-api/recipes.html#dataikuapi.dss.recipe.DSSRecipe
-
Thank you, that would be it. We are using 12.3.1 so just barely missing it 😅
-
That's very nice to know, thank you! Is it also possible to filter for minor releases? We are on 12.3 now but some functions in version 12 (like the rename function) were added later than that still.
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,160 Neuron
I don’t believe that’s possible I’m afraid. And it’s a good point because with the continuous delivery that Dataiku has adopted changes happen at every release so major releases are not really that anymore. Just a matter for marketing 😉