Hi everyone, In prefect 3.x, how can I access the ...
# ask-community
j
Hi everyone, In prefect 3.x, how can I access the inputs of a task in a hook? if I try
run.task_inputs
(for
run: TaskRun
) it gives a dictionary with empty values
n
hi @Juan Carlos Calvo Jackson -
task_inputs
are references to upstream results that this task depends on task run parameters are not stored in the API at all so you'd need to: • use
partial
as mentioned here in the docs • add them to some sort of global / nonlocal variable (or a KV) that you can access in the hook
🙏 1
c
Just an FYI, I think maybe a simpler way to access inputs is through:
Copy code
prefect.context.get_run_context().parameters
upvote 1
and i believe that will contain all passed values, not just ones that came from other tasks