Survey banner
The Dataiku Community is moving to a new home! We are temporary in read only mode: LEARN MORE

How to send custom data to scenario report?

Sunny
Level 2
How to send custom data to scenario report?

Hi,

 

I would like to return some values from the dataset that was build as a part of the scenario in the report. 

0 Kudos
1 Reply
AlexT
Dataiker

Hi @Sunny ,
You could use a python step to set scenario variable and later use these in the reporter. 

Here is an example where I add the df.shape as a variable

# -*- coding: utf-8 -*-
import dataiku
import pandas as pd
from dataiku import pandasutils as pdu
from dataiku.scenario import Scenario

# Read recipe inputs
crm_history = dataiku.Dataset("crm_history")
df = crm_history.get_dataframe()

variable_value = str(df.shape)

scenario = Scenario()

variable_param = {"df_shape_var": variable_value}
scenario.set_scenario_variables(**variable_param)

# Print all variables now available for troubleshooting
variables = Scenario().get_all_variables()
print(variables)
0 Kudos

Labels

?
Labels (1)

Setup info

?
Tags (1)
A banner prompting to get Dataiku