I'm using dask.delayed and trying the subclass-style callback example:
from dask.callbacks import Callback
class PrintKeys(Callback):
def _pretask(self, key, dask, state):
"""Print the key of every task as it's started"""
print("Computing: {0}!".format(repr(key)))
with PrintKeys:
final.compute()
It returns:
Traceback (most recent call last):
File "./demo.py", line 105, in <module>
with PrintKeys:
AttributeError: __exit__
I can write a test if its not easily reproducible.