Code Monkey home page Code Monkey logo

Comments (7)

dosubot avatar dosubot commented on August 28, 2024 2

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 files_upload method with the new files_upload_v2 method.

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].

To continue talking to Dosu, mention @dosu.

from superset.

VedantBopardikar avatar VedantBopardikar commented on August 28, 2024

Where can i find this code to replace it in superset files?

@dosu

from superset.

rusackas avatar rusackas commented on August 28, 2024

I think this has recently been patched on master. @eschutho would know the most here, I think.

from superset.

PuszekSE avatar PuszekSE commented on August 28, 2024

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).

from superset.

VedantBopardikar avatar VedantBopardikar commented on August 28, 2024

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.

from superset.

PuszekSE avatar PuszekSE commented on August 28, 2024

#29264
#29264

I believe those were related PRs

from superset.

eschutho avatar eschutho commented on August 28, 2024

Correct, the above two prs will fix this issue. There's one outstanding issue to be merged to fix the backend runtime migrations: #29721

from superset.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.