Print "Details" in a Custom Python script Scenario

Solved!
dongari
Level 2
Print "Details" in a Custom Python script Scenario

Dear Dataiku Community, 

I'm running coded Scenarios, and I would like to be able to insert in the code some checkpoints that are shown in the Details section, that now looks empty (see image). 

dataiku_scenario_details.png

This "Details" section gets populated when I run a Step-based-Scenario, and similarly I would like to use it to show relevant information about the execution of my Code-Scenario.

At the moment I'm using `print()` to insert these checkpoints, which are printing in the Log, but it is not the best solution since the Log is very verbose.

I did not find anything to do so in the Scenario API: there is the `message_sender.send()` function that looks useful if only I would be able to redirect the output in the "Details" section.

 

Thanks for your help,

Daniele


Operating system used: Unix

1 Solution
SarinaS
Dataiker

Hi @dongari,

If I understand correctly, you would like to visually see your own logging output within the scenario step screen, i.e. "Checkpoint 1 - succeeded" etc.. 

Indeed if that understanding is correct, there isn't really a way to specify step output that will display on the Last Runs tab. The main thing I can think of is creating a custom macro, where you can control the "Produced output" information displayed. However, I think this isn't quite the behavior you are looking for. Here is an example of the macro option in case you are curious though: 

Screen Shot 2022-03-10 at 1.58.12 PM.png

Macro output displayed:โ€ƒ

Screen Shot 2022-03-10 at 1.52.27 PM.pngโ€ƒ 

I would also suggest posting this on the Product Ideas page, as it seems like a potential product idea that isn't currently implemented. 

Let me know if you have any questions about this. 

Thanks,
Sarina 

View solution in original post

3 Replies
SarinaS
Dataiker

Hi @dongari,

If I understand correctly, you would like to visually see your own logging output within the scenario step screen, i.e. "Checkpoint 1 - succeeded" etc.. 

Indeed if that understanding is correct, there isn't really a way to specify step output that will display on the Last Runs tab. The main thing I can think of is creating a custom macro, where you can control the "Produced output" information displayed. However, I think this isn't quite the behavior you are looking for. Here is an example of the macro option in case you are curious though: 

Screen Shot 2022-03-10 at 1.58.12 PM.png

Macro output displayed:โ€ƒ

Screen Shot 2022-03-10 at 1.52.27 PM.pngโ€ƒ 

I would also suggest posting this on the Product Ideas page, as it seems like a potential product idea that isn't currently implemented. 

Let me know if you have any questions about this. 

Thanks,
Sarina 

dongari
Level 2
Author

Dear @SarinaS ,

thanks for your support. 
What you propose seems a good direction, I will give it a try as it seems like it can produce the nice output checkpoint at the moment I want: looks like I can create a for-loop of macros if I want intermediate results at each loop, and not just at the end.

Maybe, it is a bit more complicated than what I was expecting (i.e., a simple way to print out a string to the Details panel), but let's see. 

Thanks,

Daniele 

dongari
Level 2
Author

Indeed I could reproduce your suggestion, creating a Plugin Macro that ouputs an HTML results and then running this Macro as a Step of a Scenario.

It is a good alternative solution, but not much in my case where all the code I need is in the Library, and it would be too much pain to move part of it in a Plugin. 
Having some Dataiku API to print directly to the Details within a Recipe would be much simpler and elegant. I will propose it as a Product Idea.