David Elliott
08/04/2021, 6:36 PMobject.task_run_name
it prints the format string used to generate the mapped task name, not the actual task name. I'm using the pattern here where my task_run_name = "{table_name}"
- and I get {table_name}
output in the state handler, because that's what it's set as at the Task level, rather than it being computed at the TaskRun levelKevin Kho
map_index
and the task_full_name
which includes the map_index
. Would that work for you? You can also use the task result to see the error message. Is the purpose for debugging?David Elliott
08/04/2021, 8:41 PMdir(object)
passed in the state handler and it gave me basically all the elements of a Task (here) which doesn't include map_index or task_full_name, and on trying to access those keys I get a 'no attribute' error.
I think it's probably not possible, would be a nice addition though (to pass in the TaskRun rather than (or in addition to) the Task)
it's for outputting to slack but with the specific name of the mapped taskKevin Kho
prefect.context.get("map_index")
inside the state handler.David Elliott
08/04/2021, 9:28 PMDavid Elliott
08/04/2021, 9:35 PMprefect.context.task_run_id
with GQL to pull the task_run_name
π
had totally not considered using the context π€¦Kevin Kho