https://dagster.io/ logo
#ask-community
Title
# ask-community
a

Adrien

09/13/2022, 11:18 AM
Hi 👋 Is there a way to pass in Slack configuration and
on_success
&
on_failure
hooks to jobs defined from assets with the
define_assets_job
function? Maybe something similar to what we can do with ops-based jobs, using the
@slack_on_success
&
@slack_on_failure
hooks? Ref: https://docs.dagster.io/_apidocs/libraries/dagster-slack
plus1 3
We went for something like that:
Copy code
# works for a local run, reading a local `profiles.yml` file
dbt_run = define_asset_job(
    "dbt_run",
    AssetSelection.groups("all_dbt_models"),
    config={
        "resources": {
            "dbt": {
                "config": {
                    "project_dir": "./de-dbt",
                    "profiles_dir": os.path.join(os.path.expanduser("~"), ".dbt"),
                    "target": "dev",
                }
            },
            "slack": {"config": {"token": "slack-token"}},
        }
    },
)
... but we're getting the error:
Copy code
Received unexpected config entry "slack" at the root. Expected: "{ dbt?: { config?: Any } io_manager?: { config?: { base_dir?: (String | { env: String }) } } }".
12 Views