👋 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
should always be the outer most decorator but this use-case feels like that won't work
gentle-night-59824
05/21/2024, 7:20 PM
also, ideally would like to avoid doing this in a custom
PythonFunctionTask
definition, and just override the arguments in the default
@task
t
thankful-minister-83577
05/24/2024, 4:11 PM
can you wrap the task decorator itself? rather than adding above it?
thankful-minister-83577
05/24/2024, 4:12 PM
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.
thankful-minister-83577
05/24/2024, 4:13 PM
if you can work around those issues, feel free to add above
g
gentle-night-59824
05/24/2024, 4:18 PM
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!