Skip to content

slack operator triggers warning on link_names on its own hook #32917

Description

@kojiromike

Apache Airflow version

2.5.3

What happened

SlackWebhookOperator.__init__ has a default arg of link_names=False. Then, SlackWebhookOperator.execute calls SlackWebhookHook explicitly with link_names=self.link_names. So SlackWebhookHook.__init__ always explicitly receives a kwarg named link_names, which triggers an unavoidable warning message.

What you think should happen instead

If the user did not instantiate SlackWebhookOperator with link_names, then link_names should not be passed to SlackWebhookHook. Then there would be no warning.

How to reproduce

Call the SlackWebhookOperator without a link_names arg. Notice the warning shows up anyway.

Operating System

image: apache/airflow:2.5.3-python3.10

Versions of Apache Airflow Providers

apache-airflow-providers-amazon==7.3.0
apache-airflow-providers-celery==3.1.0
apache-airflow-providers-cncf-kubernetes==5.2.2
apache-airflow-providers-common-sql==1.3.4
apache-airflow-providers-docker==3.5.1
apache-airflow-providers-elasticsearch==4.4.0
apache-airflow-providers-ftp==3.3.1
apache-airflow-providers-google==8.11.0
apache-airflow-providers-grpc==3.1.0
apache-airflow-providers-hashicorp==3.3.0
apache-airflow-providers-http==4.2.0
apache-airflow-providers-imap==3.1.1
apache-airflow-providers-mysql==4.0.2
apache-airflow-providers-odbc==3.2.1
apache-airflow-providers-postgres==5.4.0
apache-airflow-providers-redis==3.1.0
apache-airflow-providers-sendgrid==3.1.0
apache-airflow-providers-sftp==4.2.4
apache-airflow-providers-slack==7.2.0
apache-airflow-providers-sqlite==3.3.1
apache-airflow-providers-ssh==3.5.0

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else

Even though we're in the process of upgrading from 2.5.3 to 2.6.3, I read the code in main and believe this problem still exists.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions