Skip to content

Callback subclass raises AttributeError with compute() #1124

@maxhutch

Description

@maxhutch

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions