-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Description
Apache Airflow Provider(s)
slack
Versions of Apache Airflow Providers
apache-airflow-providers-common-sql 1.16.0
apache-airflow-providers-slack 8.9.0
slack_sdk 3.32.0
Apache Airflow version
AIRFLOW_VERSION=2.10.2
Operating System
linux/macos
Deployment
Docker-Compose
Deployment details
Deploying airflow locally on docker with AIRFLOW_VERSION=2.10.2
What happened
Referencing this operator SlackAPIFileOperator in version apache-airflow-providers-slack==8.9.0
We recently upgraded our deployment requirements an apache-airflow-providers-slack was one of them (8.0.0 -> 8.9.0)
After the upgrades, our airflow slack tasks started failing with ratelimited errors, like the one below:
slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: https://slack.com/api/conversations.list[)](https://slack.com/api/conversations.list))
The server responded with: {‘ok’: False, ‘error’: ‘ratelimited’}
Previously we were using apache-airflow-providers-slack 8.0.0 - which I believe was using SlackHook.send_file (v1) -- according to changelogs this has been default bumped to v2 in ver. 8.7.0.
However, if we switch to method_version="v1", it seems to still be working.
Slack states that they will be deprecating the files.upload method in march 2025, but it looks like the SlackAPIFileOperator class still uses files.upload here , I want to ensure that our code is prepared for the changes upcoming; can we still use method_version="v1" beyond the point of deprecation? (is it using files.upload?)
I can't tell if it is or not, it just references self.hook.send_file which does seem to be explicitly in the repo?
def _method_resolver(self):
if self.method_version == "v1":
return self.hook.send_file
return self.hook.send_file_v1_to_v2
What you think should happen instead
Ideally, we would be able to use the existing SlackAPIFileOperator with the send_file_v1_to_v2 (as it is default)
How to reproduce
Reproduce with SlackAPIFileOperator using AIRFLOW_VERSION=2.10.2.
Create any DAG using the above operator and attempt to send a small .txt file to a slack channel your connection token has access to, getting this error:
slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: https://slack.com/api/conversations.list[)](https://slack.com/api/conversations.list))
The server responded with: {‘ok’: False, ‘error’: ‘ratelimited’}
Anything else
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct