dagster-io / dagster

An orchestration platform for the development, production, and observation of data assets.
https://dagster.io
Apache License 2.0
11.14k stars 1.4k forks source link

dagster-msteams: add get_client() to teams_on_success/failure run hooks to support new MSTeamsResource #17896

Open mlyons-c opened 10 months ago

mlyons-c commented 10 months ago

Dagster version

dagster, version 1.5.2

What's the issue?

The teams_on_success and teams_on_failure run hooks in the dagster-msteams package fail with AttributeError: 'MSTeamsResource' object has no attribute 'post_message' when attempting to run them using the documentation outlined in https://docs.dagster.io/_apidocs/libraries/dagster-msteams.

When digging into the codebase and comparing to the docs, the context.resources.msteams.post_message(payload=card.payload) seems to be the cause of the issue and should instead be context.resources.msteams.get_client().post_message(payload=card.payload)

What did you expect to happen?

The run hooks to run successfully when implementing them according to the docs

How to reproduce?

https://docs.dagster.io/_apidocs/libraries/dagster-msteams#dagster_msteams.teams_on_failure

Deployment type

Local

Deployment details

Basic Linux service deployment on local infrastructure

Additional information

No response

Message from the maintainers

Impacted by this issue? Give it a 👍! We factor engagement into prioritization.

yuhan commented 10 months ago

Thanks for the report. get_client().post_message(...) should work. this seems a docs issue.

mlyons-c commented 10 months ago

It needs to be updated in the docs, but the actual implementation of teams_on_success/failure from dagster_msteams/hooks.py uses the wrong implementation and causes the hooks to fail when implementing them.

yuhan commented 10 months ago

ah you are right - will fix that soon