<!here> I'm trying to iterate thru a list received...
# prefect-community
a
<!here> I'm trying to iterate thru a list received as response from a task but getting this error. How do i resolve it. thanks
Copy code
TypeError: 'GetItem' object is not iterable
👀 1
a
can you share a minimal code example?
a
Copy code
with Flow('prepare_for_etl_flow Task') as flow:
	
	athena_tables = get_athena_tablenames(group_code)

	print(type(athena_tables))
	print(athena_tables['data'])
	for athena_tbl in athena_tables['data']:
		print(athena_tbl)
getting the error in for loop
get_athena_tablenames is a task
@Avi A
d
Hey Amit, Task results are deferred to run time. If you’d like to iterate over the result of a task, take a look at: https://docs.prefect.io/core/concepts/mapping.html#mapping
👍 1
a
Thanks @Dylan
d
Anytime!