hao-num opened a new issue, #44923:
URL: https://github.com/apache/airflow/issues/44923

   ### 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](https://airflow.apache.org/docs/apache-airflow-providers-slack/8.9.0/changelog.html#id6).
 
   
   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 
](https://github.com/apache/airflow/blob/b69441dc27888012f218683b09241e5db12c37a5/providers/src/airflow/providers/slack/operators/slack.py#L230),
 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
   
   _No response_
   
   ### 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?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to