:wave: has anyone been able to set up a decorator ...
# flyte-support
g
👋 has anyone been able to set up a decorator that can modify the
@task()
arguments, specifically
pod_template
? I'm trying to set up a decorator that takes in a key and adds a node selector via the pod template. The alternative would be a helper function to construct the template but the decorator would be nicer UX
from this doc, it says
@task
should always be the outer most decorator but this use-case feels like that won't work
also, ideally would like to avoid doing this in a custom
PythonFunctionTask
definition, and just override the arguments in the default
@task
t
can you wrap the task decorator itself? rather than adding above it?
maybe play with adding it above too. for background, i think the reason we said that is because it interferes with task loading at runtime.
if you can work around those issues, feel free to add above
g
we actually already have a wrapper but we're trying to move away from it and use the native task decorator - it'd be better to maintain and there's a lot of users using it if it can cause runtime issues maybe adding above isn't the best idea, but I'll experiment I'm thinking the best solution rn might just be a helper that builds the pod template and returns a dict, and we can unpack that to pass it to the native decorator thanks for the ideas!