:wave: I’ve a problem setting a hook to an asset j...
# ask-community
👋 I’ve a problem setting a hook to an asset job, here is the minimal code with the issue:
Copy code
from dagster import asset, failure_hook, Definitions, define_asset_job

def my_asset():
    return 1

def my_hook(context):
    print("hello hook")

definitions = Definitions(
    jobs=[define_asset_job("my_job", selection='my_asset', hooks={my_hook})],
        'my_resource': None
When I run Dagit then I get:
Copy code
dagster._core.errors.DagsterInvalidDefinitionError: resource with key 'my_resource' required by hook 'my_hook' attached to job 'my_job' was not provided. Please provide a <class 'dagster._core.definitions.resource_definition.ResourceDefinition'> to key 'my_resource', or change the required key to one of the following keys which points to an <class 'dagster._core.definitions.resource_definition.ResourceDefinition'>: ['io_manager']
This error does not happen when instead of creating the job from an asset, I create it from a graph via the
method. I’m running on dagster 1.3.11
🤖 1
should I open a new issue on Github?
Hi Riccardo, thanks for the report-- this looks like a genuine bug in resource binding, yes pls open an issue on GH and we’ll get it addressed.
There's an already existing issue here
Ah, thank you Brian, apologies Riccardo I didn’t realize that hooks with SDAs weren’t currently supported!
according to your docs they should be supported https://docs.dagster.io/changelog#138-core--0198-libraries indeed from that version
accepts hooks now, before it didn’t
Sorry, linked to the wrong issue. If you check this thread here. Owen mentions a fix is coming in this week's release
👍 1