Change Recipe Engine using the API

Options
mallisundaresan
mallisundaresan Dataiku DSS Core Designer, Registered Posts: 6
edited July 16 in Using Dataiku

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/24974 . 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

Best Answer

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 1,727 Neuron
    edited July 17 Answer ✓
    Options

    Use this:

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

Answers

Setup Info
    Tags
      Help me…