Toby Rahloff
06/22/2022, 12:55 PMSylvain Hazard
06/22/2022, 1:21 PMbucket_objects = get_buckets + count_bucket_objects(bucket.name)
because get_buckets
is a Task itself.
Shouldn't you be doing something like bucket_objects += count_bucket_objects(bucket.name)
?
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.Toby Rahloff
06/22/2022, 2:26 PMTypeError: unsupported operand type(s) for +=: 'int' and 'PrefectFuture'
Any idea what I am doing wrong?Sylvain Hazard
06/22/2022, 2:35 PMbucket_objects += count_bucket_objects(bucket.name).result()
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.PrefectFuture
objects. The actual result values behind these can be accessed either by passing the Future as parameter to another Task or by calling my_future.result()
Toby Rahloff
06/22/2022, 2:49 PMSylvain Hazard
06/22/2022, 3:10 PM