Thread
#prefect-community
    a

    Amit Singh

    2 years ago
    <!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
    TypeError: 'GetItem' object is not iterable
    a

    Avi A

    2 years ago
    can you share a minimal code example?
    a

    Amit Singh

    2 years ago
    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
    Dylan

    Dylan

    2 years ago
    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
    a

    Amit Singh

    2 years ago
    Thanks @Dylan
    Dylan

    Dylan

    2 years ago
    Anytime!