Announcing the winners & finalists of the Dataiku Frontrunner Awards 2021! Read their inspiring stories

Returning error from a python-scripted Scenario

Solved!
Keufran
Level 2
Returning error from a python-scripted Scenario

Hello Dataiku-world,

I'm looking for a way to return a status (OK, ERROR) from a custom scripted scenario (Python, DSS 7.02)

I naivly tried the following:

scenario = Scenario()

scenario.outcome= "OK" (or "ERROR")

But this don't work. Even throwing an exception from my code is intercepted and the scenario appears to be executed correctly.

0 Kudos
1 Solution
MarcH
Dataiker
Dataiker

Hello,

Are you just trying to get the scenario to fail?

How are you throwing the exception in your code? I was able to get a Python scenario to fail by simply raising an exception:

raise Exception('failed run')

 

View solution in original post

0 Kudos
2 Replies
MarcH
Dataiker
Dataiker

Hello,

Are you just trying to get the scenario to fail?

How are you throwing the exception in your code? I was able to get a Python scenario to fail by simply raising an exception:

raise Exception('failed run')

 

View solution in original post

0 Kudos
Keufran
Level 2
Author

It seems I missed something when throwing the exception... Your solution works perfectly.

0 Kudos
A banner prompting to get Dataiku DSS