Python API - difference between run.get_details()['result'] and run.get_info()['result']

Solved!
JohnB
Level 3
Python API - difference between run.get_details()['result'] and run.get_info()['result']

Hi,

I'm finding that aborted scenario runs do not always have a result in get_details() but there is in get_info().

Which method is guaranteed to return a result outcome? Is there a difference?

0 Kudos
1 Solution
KimmyC
Dataiker

Hi,

You can try the following code:

import dataiku
from dataiku import pandasutils as pdu
import pandas as pd

client = dataiku.api_client()
proj = client.get_project("your_project_id")
s = proj.get_scenario("your_scenario_id")
print s.get_last_runs()[0].get_details()['scenarioRun']['result']
print s.get_last_runs()[0].get_info()['result']

This should return the same results for both, even for aborted runs. Hope it helps!

View solution in original post

0 Kudos
1 Reply
KimmyC
Dataiker

Hi,

You can try the following code:

import dataiku
from dataiku import pandasutils as pdu
import pandas as pd

client = dataiku.api_client()
proj = client.get_project("your_project_id")
s = proj.get_scenario("your_scenario_id")
print s.get_last_runs()[0].get_details()['scenarioRun']['result']
print s.get_last_runs()[0].get_info()['result']

This should return the same results for both, even for aborted runs. Hope it helps!

0 Kudos