Change Recipe Engine using the API

Solved!
mallisundaresan
Level 2
Change Recipe Engine using the API

Hi Dataiku Team,

I am able to change the engine of prepare recipes using the code here  :https://community.dataiku.com/t5/Setup-Configuration/Change-a-recipes-engine-using-the-API/td-p/2497... . But it fails for other recipes like join and group. I have verified in the UI that these recipes have both SPARK and DSS as the engine options. I want to change their engine from SPARK to DSS. The error I get is shown below:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-99-f75ef26b38e9> in <module>
      1 settings = recipe.get_settings()
----> 2 settings.raw_params['engineType'] = 'DSS'
      3 settings.save()

/opt/dataiku-dss-12.5.1/python/dataikuapi/dss/recipe.py in raw_params(self)
    527         :rtype: dict
    528         """
--> 529         return self.recipe_settings["params"]
    530 
    531     def _payload_to_str(self):

KeyError: 'params'

Can anyone help me resolve this issue?


Operating system used: Linux

0 Kudos
1 Solution
Turribeach

Use this:

settings = recipe.get_settings()
settings.get_json_payload['engineType'] = "DSS"
settings.save

 

View solution in original post

0 Kudos
2 Replies
Turribeach

Use this:

settings = recipe.get_settings()
settings.get_json_payload['engineType'] = "DSS"
settings.save

 

0 Kudos
mallisundaresan
Level 2
Author

This worked. Thank you!

0 Kudos