https://dagster.io/ logo
#announcements
Title
# announcements
l

Liam Coatman

04/12/2021, 10:51 AM
Hello! I'm new to Dagster and have a question about Dagstermill. I want to retry my notebook solid if the notebook raises an exception. If this was a regular solid I think I would do something like
Copy code
@solid
def flakes():
    try:
        flakey_operation()
    except:
        raise RetryRequested(max_retries=3)
And so from my notebook I would like to do something like
Copy code
dagstermill.yield_event(RetryRequested(max_retries=3))
However, this isn't allowed because the argument to
yield_event
is of type
Union[dagster.Materialization, dagster.ExpectationResult, dagster.TypeCheck, dagster.Failure]
. Is there a workaround for this? Or more generally, is this the correct pattern for retrying a notebook or is there a better approach? Thanks! cc: @victor
a

alex

04/12/2021, 3:06 PM
hm ya this appears to be an oversight with how dagstermill and retries work
@Dagster Bot issue retries in dagstermill
d

Dagster Bot

04/12/2021, 3:06 PM
a

alex

04/12/2021, 3:07 PM
cc @max incase theres something im overlooking
m

max

04/12/2021, 4:37 PM
no i think this is a straight oversight
l

Liam Coatman

04/12/2021, 4:45 PM
Thanks for looking into it
v

victor

04/13/2021, 9:30 AM
@max, @alex - Would this be fixed just by adding
RetryRequested
to the allowed types in the runtime type check of
Manager.yield_event
or does it need more work in the papermill solid driver?
a

alex

04/13/2021, 2:26 PM
believe it will need a little more work - looking in to it
keanu thanks 1
diff out should make it in for the release this week
l

Liam Coatman

04/13/2021, 5:03 PM
Thanks @alex, appreciate it!