Is there any nice way to modify the arguments give...
# prefect-community
Is there any nice way to modify the arguments given in the
decorator after that task has been defined? Say I use a task from a collection that and want to use a custom
. It looks like i could do it by
Copy code
from copy import copy
from some_collection import some_task
some_task_cache = copy(some_task)
some_task_cache.cache_key_fn = my_cache_fn
but that seems a bit hacky. The actual problem is the other way around - I want to provide a collection for users, but they would want to modify the task decorator arguments.
Hey @Stefan Rasmussen Assuming this is for prefect 2 you can do this using the with_options method available on any task function I'm not sure if this is available for prefect 1 as best I can tell it's not
Thanks! Exactly what I need. Yes, it's for Prefect 2. Maybe it would make sense to put in the Task section of the docs? The Task arguments section only mentions using the decorator