Add first_error_details as custom variable in reporter

tomasu
tomasu Registered Posts: 3 ✭✭✭
edited July 16 in Using Dataiku

I'm trying to add a custom variable to reporter, first_error_detail:

settings = scenario.get_last_finished_run()
details  = settings.get_details()
details.first_error_details

# >> {'message': "Error in Python process: At line 135: <class 'KeyError'>: rebates"}

However I'm able to find any documentation about the mapping from the above method to the json in the custom variable creation:

import json
# compute your additional variables from the list of report items 
# and return them as a dictionary.
def get_variables(items_json, scenario_run_json, step_run_output_json):
    items = json.loads(items_json)
    return {}

I'm assuming it resides in scenario_run_json, but with no schema or documentation to refer to, it's proving to be quite the exercise. Any help here would be greatly appreciated!

Tagged:
Setup Info
    Tags
      Help me…