Skip to content

Conversation

@kojiromike
Copy link


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
Copy link

boring-cyborg bot commented Jul 28, 2023

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

Copy link
Member

@hussein-awala hussein-awala left a comment

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 {}),
Copy link
Member

@hussein-awala hussein-awala Jul 28, 2023

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
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
Copy link
Member

potiuk commented Aug 3, 2023

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
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
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