Skip to content

Fix link_names parameter not being passed to hook in SlackWebhookOperator#32919

Closed
kojiromike wants to merge 1 commit into
apache:mainfrom
kojiromike:bug-23917
Closed

Fix link_names parameter not being passed to hook in SlackWebhookOperator#32919
kojiromike wants to merge 1 commit into
apache:mainfrom
kojiromike:bug-23917

Conversation

@kojiromike

Copy link
Copy Markdown

Only pass link_names if it has a non-Falsy value

Resolve #32917 by ensuring that SlackWebhookOperator only passes link_names to SlackWebhookHook if it has a non-Falsy value.

@boring-cyborg

boring-cyborg Bot commented Jul 28, 2023

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@hussein-awala hussein-awala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check STATIC_CODE_CHECKS doc to fix the failed test

Comment on lines +172 to +173
# Unused Parameters, warn user if not None
**({"link_names": self.link_names} if self.link_names else {}),

@hussein-awala hussein-awala Jul 28, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a unit test to ensure that the argument is not provided when it's False?

@eladkal eladkal changed the title #32917 Only Pass link_names if it is not Falsy Fix link_names parameter not being passed to hook in SlackWebhookOperator Jul 29, 2023
@kojiromike

Copy link
Copy Markdown
Author

I have been unable to get Breeze to build successfully so far. I'll keep trying, but it may take some time. If anyone wants to help, it would be appreciated.

@potiuk

potiuk commented Aug 3, 2023

Copy link
Copy Markdown
Member

I have been unable to get Breeze to build successfully so far. I'll keep trying, but it may take some time. If anyone wants to help, it would be appreciated.

I wonder what errors you had ?

Comment on lines +172 to +173
# Unused Parameters, warn user if not None
**({"link_names": self.link_names} if self.link_names else {}),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Unused Parameters, warn user if not None
**({"link_names": self.link_names} if self.link_names else {}),

AFAIK I mark this value as not used for about I year, so we could just remove provide it in to the hook.

@Taragolis

Copy link
Copy Markdown
Contributor

@kojiromike link_names completely removed in #33557, changelog and advice about migration to 8.0.0 https://airflow.apache.org/docs/apache-airflow-providers-slack/stable/changelog.html#breaking-changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

slack operator triggers warning on link_names on its own hook

5 participants