Search code examples
pythonamazon-web-servicesbotoemrelastic-map-reduce

AWS EMR: how to get the first element out of describe_jobflows() API call result


I cannot figure out how to get the first element of the result from calling one of the boto emr APIs:

describe_jobflows()

i know it returns a list of jobflows, but when I'm trying to access it by using :

jobflows[0]

I got this:

ERROR: 'JobFlow' object is not iterable

Can anyone help please?


Solution

  • All right. Problem solved.

    I was doing:

    jobflows += terminatedjobflows[0]
    

    that's why it's complaining: object jobflow is not iterable

    when I changed it to:

    jobflow.append(terminatedjobflows[0])
    

    it works.