-
Notifications
You must be signed in to change notification settings - Fork 4
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
Update Slack File Upload API #177
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Yuyutsu Rai <[email protected]>
Signed-off-by: Yuyutsu Rai <[email protected]>
response = client.files_upload( | ||
channels=f"#{slack_channel}", | ||
response = client.files_upload_v2( | ||
channel=slack_channel, | ||
content=content, | ||
filetype=file_type, |
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 got these errors when running it:
UserWarning: The filetype parameter is no longer supported. Please remove it from the arguments.
warnings.warn("The filetype parameter is no longer supported. Please remove it from the arguments.")
Slack notification errored
Error: channel_not_found
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.
Sorry for the late reply, my GPG key was expired but it is now updated 👍
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.
It's also the channel that is causing the error.
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.
Updated and Working 🤞
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.
Looks good! Tests passed locally, I also was able to run a benchmark with results being outputted to the correct channel
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.
Tested it multiple times using own Slack channel, requires pipeline changes going in first.
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.
Tested the channel name removal, works as expected!
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.
Re-ran the tests and all pass, and changes work well, looks good!
What is the context of this PR?
This PR is to update the deprecated Slack File Upload method which will be replaced March 2025.
Slack Client has been replaced by Slack's Python SDK. Migration To SDK
Benchmark Pipelines PR: https://github.com/ONSdigital/eq-pipelines/pull/656/files#diff-69a76bccc721b7c5ce6002eded0909122e79faea147db3efd53e1867a3b682a8
How to review