-
Notifications
You must be signed in to change notification settings - Fork 16.3k
fix: When using Slack V2, file is changed to BytesIO #36094
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
base: master
Are you sure you want to change the base?
Conversation
Code Review Agent Run #f4672aActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've completed my review and didn't find any issues.
Files scanned
| File Path | Reviewed |
|---|---|
| superset/reports/notifications/slackv2.py | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
|
@gabotorresruiz you've been digging into the slack code a bit, have you been seeing this too? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where CSV files sent via Superset Reports to Slack using the V2 API were displayed as plain text instead of properly formatted CSV files. The fix wraps the raw bytes data in a BytesIO object before passing it to the Slack V2 files_upload_v2 API, which expects a file-like object.
- Converts raw bytes to BytesIO object for Slack V2 API compatibility
- Adds necessary import for the io module
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #36094 +/- ##
===========================================
+ Coverage 0 48.22% +48.22%
===========================================
Files 0 631 +631
Lines 0 45968 +45968
Branches 0 4981 +4981
===========================================
+ Hits 0 22168 +22168
- Misses 0 23175 +23175
- Partials 0 625 +625
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hmm I haven't tested this, but I can definitely take a look |
SUMMARY
I add ALERT_REPORT_SLACK_V2: True in FEATURE_FLAGS.
After switching to the Slack V2 API, I'm now sending .csv files via Superset Reports. The following issue has occurred. Slack should display the data as CSV, but it's being displayed as plain text.
Note that this issue didn't occur in Slack V1. Please see the screenshot below.
So, I discovered the issue in the Slack V2 code, fixed it, and confirmed that the CSV file is now displayed properly in Slack.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Slack V1

Slack V2

TESTING INSTRUCTIONS
ADDITIONAL INFORMATION