Philipp G
10/31/2019, 2:05 PMTypeError
). However, since dagster catches that error and turns it into another type of error, I have to do something like this:
import unittest
from dagster import DagsterExecutionStepExecutionError, execute_solid, lambda_solid
@lambda_solid
def add_one(x):
return x + 1
class AddOneTest(unittest.TestCase):
def test_fail_for_string(self):
with self.assertRaises(DagsterExecutionStepExecutionError):
execute_solid(add_one, input_values={"x": "s"})
Any good ideas on how I can test for the underlying TypeError
instead of the dagster error easily?alex
10/31/2019, 3:36 PMraise_on_error
flag that we dont expose on execute_solid
that we probably should. It is available on execute_pipeline
so you could try it there by manually wrapping your solid to test in a pipeline and verify if that approach works.max
10/31/2019, 4:18 PMPhilipp G
11/04/2019, 10:09 AMexecute_pipeline
. Then I can set raise_on_error = False
and get the return value from execute_pipeline
without failing. I think that is what you meant?
The easiest way to get to the TypeError
I want, when res
is the PipelineExecutionResult
I got: Finding the last event with event_type_value='STEP_FAILURE'
, in this case the third from last, then calling res.event_list[-3].step_failure_data.error.clas_name
. I am happy that there is a way to get this, but maybe a helper for getting to this more easily like max said would help.alex
11/04/2019, 4:14 PMalex
11/04/2019, 4:15 PMexecute_solid
out in the next releasealex
11/04/2019, 4:53 PMPhilipp G
11/05/2019, 7:23 AMalex
11/13/2019, 7:37 PM