[lowpri / minor] How do I use `with_retry_policy` ...
# ask-community
l
[lowpri / minor] How do I use
with_retry_policy
with Dynamic Ops? My workaround is to create a new op
def live_pricing_op_no_retry()
and set
@op(retry_policy=<http://configs.NO|configs.NO>_RETRY_POLICY)
a
you should be able to do the same thing shown in you first screen shot, but instead of invoking it right away like
sample.with_retry_policy(...)()
you will pass the fn to map without invoking it
dynamic.map(sample.with_retry_policy(...))
functions on
op
definitions like
with_retry_policy
or
alias
are sort of like
functools.partial
, they create a “pending op invocation” that has additional tweaks over the base
op
definition that get locked in once its invoked and dependencies are established
❤️ 1
l
will the job-level retry policy override the op retry policy? i.e. policy_b will be applied here for sample_job’s sample op?
Copy code
@op(retry_policy=policy_a)
def sample():
  ...

@job(op_retry_policy=policy_b)
def sample_job():
  sample.with_retry_policy(policy_b)