Toby Rahloff06/22/2022, 12:55 PM
Sylvain Hazard06/22/2022, 1:21 PM
bucket_objects = get_buckets + count_bucket_objects(bucket.name)
is a Task itself. Shouldn't you be doing something like
? Also as an aside, you have a nice task for retrieving all your bucket names but you don't use them in your flow, missing all that exception management you did.
bucket_objects += count_bucket_objects(bucket.name)
Toby Rahloff06/22/2022, 2:26 PM
Any idea what I am doing wrong?
TypeError: unsupported operand type(s) for +=: 'int' and 'PrefectFuture'
Sylvain Hazard06/22/2022, 2:35 PM
as referenced here. Alternatively you could create a task to add numbers which would allow you to have the Future's result directly but it feels a bit too verbose for such a simple thing.
bucket_objects += count_bucket_objects(bucket.name).result()
objects. The actual result values behind these can be accessed either by passing the Future as parameter to another Task or by calling
Toby Rahloff06/22/2022, 2:49 PM
Sylvain Hazard06/22/2022, 3:10 PM