Skip to content

Conversation

@bshea5
Copy link
Contributor

@bshea5 bshea5 commented Jan 14, 2025

Closes: #45626


As noted in the most recent change log, https://airflow.apache.org/docs/apache-airflow-providers-pagerduty/stable/changelog.html, switch the create_event method to send_event. This PR fixes the provider as it still uses the prior method.

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg
Copy link

boring-cyborg bot commented Jan 14, 2025

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 Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.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.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    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

@bshea5
Copy link
Contributor Author

bshea5 commented Jan 14, 2025

Covers issue #45630

Copy link
Contributor

@eladkal eladkal left a comment

Choose a reason for hiding this comment

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

The fact that we didn't catch this when create_event was removed from the hook means that something is not working properly with the tests.
Merging to unblock the notifier but would be cool if someone has the time to look into the tests

@eladkal eladkal changed the title Fix PagerDuty Provider PagerDuty Notifier: Replace deleted method create_event with send_event (bugfix): replace create_event with send_event in PagerdutyNotifier Jan 15, 2025
@eladkal eladkal merged commit e164f3c into apache:main Jan 15, 2025
17 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 15, 2025

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@potiuk
Copy link
Member

potiuk commented Jan 16, 2025

The fact that we didn't catch this when create_event was removed from the hook means that something is not working properly with the tests. Merging to unblock the notifier but would be cool if someone has the time to look into the tests

.They were just mocking hook's methods not API methods. But the fact is that MyPy should detect it. For some reason it did not. The "self.hook" is clearly PagerdutyEventsHook and it does not have create_event so there should be no attr_defined or similar mypy error ... but you never know with MyPy. Sometimes it does not detect obvious things like that.

Potentially we could mock pdpyras.EventsAPISession(self.integration_key) session usage rather than hook usage and it would be detected in the tests.

HariGS-DB pushed a commit to HariGS-DB/airflow that referenced this pull request Jan 16, 2025
…ier` (apache#45630)

* (bugfix): replace `create_event`  with `send_event`  in `PagerdutyNotifier`
---------

Co-authored-by: Brandon Shea <bshea5@gmail.com>
dauinh pushed a commit to dauinh/airflow that referenced this pull request Jan 24, 2025
…ier` (apache#45630)

* (bugfix): replace `create_event`  with `send_event`  in `PagerdutyNotifier`
---------

Co-authored-by: Brandon Shea <bshea5@gmail.com>
got686-yandex pushed a commit to got686-yandex/airflow that referenced this pull request Jan 30, 2025
…ier` (apache#45630)

* (bugfix): replace `create_event`  with `send_event`  in `PagerdutyNotifier`
---------

Co-authored-by: Brandon Shea <bshea5@gmail.com>
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.

PagerDuty PagerdutyNotifier Class Uses a Removed Method and Fails to Send Notifications

3 participants