Project macro not returning Dataset selection

Options
Marlan
Marlan Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Dataiku Frontrunner Awards 2021 Participant, Neuron 2023 Posts: 316 Neuron

Hello,

I am trying to develop a macro that can be run from the project Macros menu. When I specify a DATASET parameter, the macro displays a list of datasets but doesn't return the value selected. Any ideas?

Here is the runnable.json file:

{"meta": {"label": "Custom runnable test-dataset-param","description": "Test dataset parameter","icon": "icon-puzzle-piece"},"impersonate": false,"params": [{"name": "source_dataset","label": "Source Dataset","type": "DATASET","description": "Specify the dataset","mandatory": true}],"permissions": [],"resultType": "HTML","resultLabel": "Result label","extension": "txt","mimeType": "text/plain","macroRoles": [{"type": "PROJECT_MACROS"}]}

For this test, in the runnable.py file I'm simply returning the whole config, i.e.: return self.config

I realize I can make this macro available in the dataset actions in the flow. That works. Maybe that's what I'll need to do but thought I'd explore whether the project macro approach could work as well as this would be my preferred approach.

Thanks,

Marlan

Best Answers

Answers

  • duphan
    duphan Dataiker, Registered Posts: 32 Dataiker
    Options

    Hi, what is the version of your DSS ?

    When you say the macro does not return the value selected, is that in the config dict you don't see the "source_dataset" key ?

  • Marlan
    Marlan Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Dataiku Frontrunner Awards 2021 Participant, Neuron 2023 Posts: 316 Neuron
    Options

    Thanks @Clément_Stenac
    . OK sounds like this will work in v7.

    Marlan

  • Marlan
    Marlan Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Dataiku Frontrunner Awards 2021 Participant, Neuron 2023 Posts: 316 Neuron
    Options

    Hi @duphan
    ,

    Yes, our version is 6.03 I believe.

    The config dict is empty. It doesn't contain the key "source_dataset" let alone a value for that key.

    Sounds like this may work in v7 per @Clément_Stenac
    .

    Thanks,

    Marlan

  • Marlan
    Marlan Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Dataiku Frontrunner Awards 2021 Participant, Neuron 2023 Posts: 316 Neuron
    Options

    OK, thanks for confirming.

    Marlan

Setup Info
    Tags
      Help me…