https://www.orchest.io/ logo
f

Fran

08/23/2021, 5:25 PM
Hello everyone 👋, my name is Franccesco Orozco (call me Fran!). I'm Chief Data Scientist at Radial, Inc. and I'm a fan of building pipelines. I saw Orchest and I was hooked at the potential it has.
🔥 1
👋 2
y

Yannick

08/23/2021, 5:50 PM
Hi @Fran! That’s awesome 👏 Any cool pipelines you have build so far?
f

Fran

08/23/2021, 6:14 PM
@Yannick Nothing out of the ordinary but I wrote a small package to use it in-house that let us know if a notebook got an error and reports it to our Slack workspace. It’s pretty handy if you want to have real time information of the execution of a notebook.
I know Orchest is in alpha, but I plan to use it extensively for testing. I can share my thoughts and feedback if you need it 🙂
r

Rick Lamers

08/24/2021, 7:50 AM
Welcome Fran. Very nice to meet you! The Slack integrations have been working really well for us too. I wrote a small snippet that sends images of plots to our Slack in a notebook as part of a simple analytics pipeline. Works wonderfully!
f

Fran

08/24/2021, 1:56 PM
Hey that’s a great idea! I’m just using the Workflow Builder to listen for updates but you can’t send images like that. I assume you created your app in Slack?
y

Yannick

08/24/2021, 2:31 PM
You could use the
slack-sdk
to send messages, for example: https://slack.dev/python-slack-sdk/web/index.html
👀 1
r

Rick Lamers

08/24/2021, 2:37 PM
Copy code
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError

def send_slack_message(message):
    client = WebClient(token=os.environ['SLACK_BOT_TOKEN'])
    try:
        response = client.chat_postMessage(channel='#mychannel', text=message)
    except SlackApiError as e:
        # You will get a SlackApiError if "ok" is False
        assert e.response["ok"] is False
        assert e.response["error"]  # str like 'invalid_auth', 'channel_not_found'
        print(f"Got an error: {e.response['error']}")
We upload the image to S3 and put the URL in the message. Slack generates the image preview automatically (as long as the S3 bucket is set to public)
f

Fran

08/24/2021, 2:41 PM
Oh, that makes sense. I want to build my own slack bot but the workflow builder in Slack got me spoiled 😂