0

I have (~600) earth engine tasks that I'm hoping to cancel automatically because I know they will fail. However, some of my exports are vectors and they will likely succeed. How can I iterate over all running tasks and cancel those that are images?

Sean Carter
  • 121
  • 8

1 Answers1

0

The only thing I could find was this answer, which uses ipygee, that did not install properly for me.

Here is my solution:

import ee
ee.Initialize()


tasks = ee.data.listOperations()


img_tasks_to_cancel = []
# Iterate over all tasks and store the image tasks
for task in tasks:

    if task['metadata']['type'] == 'EXPORT_IMAGE':
        # Default "name" is a url, so find the task id from that URL
        img_tasks_to_cancel.append(task['name'].split('/')[-1])
Sean Carter
  • 121
  • 8