-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slack Notification - deprecated API #29480
Comments
Hey there, @PuszekSE! I'm here to help you with any bugs, questions, or contributions you have. Let's work together to resolve this issue. To resolve the issue of sending notifications via Slack failing due to a deprecated Slack API method in your Superset deployment, you should update your Slack app to use the new API methods. Specifically, you should replace the deprecated Here is the relevant part of the code that shows the use of the new method: # files_upload returns SlackResponse as we run it in sync mode.
for channel in channels:
if len(files) > 0:
for file in files:
client.files_upload_v2(
channel=channel,
file=file,
initial_comment=body,
title=title,
)
else:
client.chat_postMessage(channel=channel, text=body) Ensure that your Slack app has the necessary permissions and scopes to use the new API methods. If the new method fails, the code falls back to the deprecated method, but this should be avoided by updating your Slack app configuration [1]. |
Where can i find this code to replace it in superset files? |
I think this has recently been patched on master. @eschutho would know the most here, I think. |
I've checked this on 4.0.2-dev, 1-2 days after its release (although that isn't an option present on the version dropdown list). |
changing the function in superset/reports/notifications/slack.py. from files_upload to files_upload_v2 worked for me. Also the recipients in superset for slack should be channel IDs and not usernames. |
Correct, the above two prs will fix this issue. There's one outstanding issue to be merged to fix the backend runtime migrations: #29721 |
@eschutho With reference to the link #29480 (comment) |
@dosu getting error
where do i need to change the |
If you are running Superset 4.1 or later you will be using the Slack v2 api if your Slack app has the correct scopes. Your logs will say which scopes you need to add if they are missing. You will also need to set this flag to true: |
To resolve the error related to the deprecated Slack API method, you need to update the Superset codebase, not the Helm chart itself. Specifically, you should modify the Here's a brief guide on how to do this:
This change should resolve the error you're encountering with the deprecated Slack API method. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Bug description
When attempting to send the notification it seems to be failing due to Slack API deprecation:
How to reproduce the bug
Screenshots/recordings
Superset version
master / latest-dev
Python version
Not applicable
Node version
Not applicable
Browser
Not applicable
Additional context
It's k8s based deployment based on 4.0.2rc-dev image if that matters anyhow.
Checklist
The text was updated successfully, but these errors were encountered: