hi, how can I set `op_retry_policy` on `define_ass...
# ask-community
e
hi, how can I set
op_retry_policy
on
define_asset_job
?
tags={"dagster/max_retries": 2}
would probably work. But I'm also interested in controlling delay between retries..
j
Take a look at this, I think it answers your questions.... https://docs.dagster.io/concepts/ops-jobs-graphs/op-retries#retrypolicy
Copy code
@op(
    retry_policy=RetryPolicy(
        max_retries=3,
        delay=0.2,  # 200ms
        backoff=Backoff.EXPONENTIAL,
        jitter=Jitter.PLUS_MINUS,
    )
)
def even_better():
    fails_sometimes()
e
That's not it, it's is for
op
. We have a job that materializes assets via
define_asset_job
. You can pass op retry policy (the one that you mentioned) when you define custom job via
job
decorator. But not for
define_asset_job
as far as I can tell.
j
If you want to define retry on the asset level you can use
retry_policy
via @asset (api link included). On the job level, I’m not sure if you can control the delay but there is a
retry_strategy
tag which I don’t use on asset jobs but probably still works. https://docs.dagster.io/_apidocs/assets
e
we're loading most of the assets from airbyte and dbt atm, with
load_assets_from_airbyte_instance
&
load_assets_from_dbt_project
, so no decorator. And I want to set retries based on the job and not on the asset, if possible.
183 Views