How to send custom data to scenario report?

Options
Sunny
Sunny Registered Posts: 6

Hi,

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

Tagged:

Answers

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

    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 dataikuimport pandas as pdfrom dataiku import pandasutils as pdufrom dataiku.scenario import Scenario# Read recipe inputscrm_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 troubleshootingvariables = Scenario().get_all_variables()print(variables)
Setup Info
    Tags
      Help me…