Skip to content

Rate-limited when using SlackAPIFileOperator with channel name #47225

@zachliu

Description

@zachliu

Apache Airflow version

main (development)

If "Other Airflow 2 version" selected, which one?

2.10.4

What happened?

Reopening #44923

Per Slack API rate limits, a sleep(interval) is needed in

and interval should be an input argument, otherwise we can never use the friendly channel names and have to use the unreadable channel IDs

What you think should happen instead?

A configurable sleep should be used right after

retried_channel_id = self.get_channel_id(channel_id[1:])

to get around Slack's rate limits

How to reproduce

Use SlackAPIFileOperator with a channel name:

slack_operator_file_content = SlackAPIFileOperator(
    task_id="slack_file_upload",
    dag=dag,
    slack_conn_id="slack",
    channels="#general",
    initial_comment="Hello World!",
    content="file content in txt",
)

Operating System

ubuntu debian

Versions of Apache Airflow Providers

All versions after 8.9.0+

Deployment

Other Docker-based deployment

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions