Create Project Macro - Ambiguous componentId Error

Dominic-S
Dominic-S Registered Posts: 17

Hi,

I have a Create Project Macro, which will give me the following error when I have a dynamic select parameter in runnable.json. If I changed the param to static select, it will work.

What am I missing?

Thanks,

Error Message:

"message": {
"callPath": "/api/plugins/call-python-do",
"auditTopic": "generic",
"msgType": "plugin-python-do",
"componentId": "template-odf",
"authSource": "USER_FROM_UI",
"pluginId": "odf-template",
"errorType": "com.dataiku.dip.CodedRuntimeException",
"errorMsg": "Ambiguous componentId template-odf matches 2 components",
},

Code fragments:

runnable.json:

"paramsPythonSetup": "template_choices.py",
{
"name": "owner",
"label": "Owner",
"type": "SELECT",
"getChoicesFromPython": true,
"mandatory": true
},
do method in resource/template_choices.py:
import dataiku
def do(payload, config, plugin_config, inputs
dss_client = dataiku.api_client()
users = dss_client.list_users()
user_array = []
if payload.get('parameterName') == 'owner':
for user in users:
login_user = dss_client.get_user(user['login'])
user_array.append({'value':login_user,'label':login_user})

return {"choices": user_array}

Best Answer

  • Alexandru
    Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,225 Dataiker
    Answer ✓

    Hi @Dominic-S
    ,
    The error :Ambiguous componentId template-odf matches 2 components", suggests you have multiple component with the same ID "template-odf". Based on the code snippets provided alone, I can't see where this is occurring you may have other component types with the same id.
    As I am unable to create 2 components with the same ID of the same type from the UI.

    Could you please create a support ticket with a zip of the plugin so we can debug further?
    Thanks,


Answers

  • Dominic-S
    Dominic-S Registered Posts: 17

    Hi Alex,

    Thanks for your reply.

    What puzzles me is that if I hard-coded the select's choices, instead of using "getChoicesFromPython", I will not get that error.

    Thanks,

  • Dominic-S
    Dominic-S Registered Posts: 17

    Hi Alex,

    How can I find out the componentId, I am able to find the pluginId from plugin.json, but I don't know where I can find the component Id from either runnable.json or connector.json

    Thanks

  • Alexandru
    Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,225 Dataiker

    The component ID is the one defined blow it create a folder with that id

    Screenshot 2023-07-11 at 5.00.51 PM.pngScreenshot 2023-07-11 at 5.00.44 PM.png

    As mentioned I thin it would be easiest if you can submit a support ticket with the current export of the plugin and your confirming your DSS, to help us understand and reproduce this.

  • Dominic-S
    Dominic-S Registered Posts: 17

    Hi Alex,

    I will submit a support ticket as you suggested.

    Thanks

Setup Info
    Tags
      Help me…