https://prefect.io logo
Title
t

Tibs

11/22/2022, 4:50 PM
Hi, I am looking for some help with prefect_sqlalchemy for how I could customize the sqlalchemy_execute task? Like giving a custom name, number of retries if it is possible
n

Nate

11/22/2022, 5:03 PM
Hey @Tibs you can use
with_options
to change the settings of your task or flow like
In [11]: from prefect_sqlalchemy.database import sqlalchemy_execute

In [12]: sqlalchemy_execute.name, sqlalchemy_execute.retries
Out[12]: ('sqlalchemy_execute', 0)

In [13]: my_new_task = sqlalchemy_execute.with_options(name="My SQL Alchemy Execute", retries=2)

In [14]: my_new_task.name, my_new_task.retries
Out[14]: ('My SQL Alchemy Execute', 2)
❤️ 1
t

Tibs

11/23/2022, 7:18 AM
Thanks a lot @Nate
:party-parrot: 1