https://dagster.io/ logo
#dagster-support
Title
# dagster-support
s

Stephen Bailey

03/13/2022, 8:14 PM
I'm running into an issue trying to configure Slack notifications on failures. The slack resource works well when called directly from an op, but for some reason the repository fails with the error of
UserWarning: Error loading repository location slack_test.py:TypeError: unsupported operand type(s) for +: 'JobDefinition' and 'RunStatusSensorDefinition'
Any clues why?
Copy code
from dagster import job, op, repository
from dagster_slack import make_slack_on_run_failure_sensor

slack_sensor = make_slack_on_run_failure_sensor(
    "#data-alerts",
    "my_token"
)

@op
def my_failure():
    raise Exception("This is a planned failure.")

@job
def my_job():
    my_failure()

@repository
def my_repo():
    return [my_job + slack_sensor]
1
r

rex

03/13/2022, 8:17 PM
a repository specifies a list of items - you'll want a comma instead of a plus: https://docs.dagster.io/concepts/repositories-workspaces/repositories#defining-a-repository
Copy code
@repository
def my_repo():
    return [my_job, slack_sensor]
s

Stephen Bailey

03/13/2022, 8:18 PM
faceplam
🥴 2
thanks @rex