Skip to content

Bumping min version of pagerduty to 2.3.0 #52214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 25, 2025

Conversation

amoghrajesh
Copy link
Contributor

CI is failing with:

providers/pagerduty/src/airflow/providers/pagerduty/hooks/pagerduty_events.py:135: error:
Argument 1 to "EventsApiV2Client" has incompatible type "Optional[str]";
expected "str"  [arg-type]
            client = pagerduty.EventsApiV2Client(self.integration_key)
                                                 ^~~~~~~~~~~~~~~~~~~~
providers/pagerduty/src/airflow/providers/pagerduty/hooks/pagerduty_events.py:136: error:
Incompatible return value type (got "str", expected "dict[Any, Any]") 
[return-value]
            return client.send_event(**data)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~
providers/pagerduty/src/airflow/providers/pagerduty/hooks/pagerduty_events.py:228: error:
Argument 1 to "EventsApiV2Client" has incompatible type "Optional[str]";
expected "str"  [arg-type]
            client = pagerduty.EventsApiV2Client(self.integration_key)
                                                 ^~~~~~~~~~~~~~~~~~~~
providers/pagerduty/src/airflow/providers/pagerduty/hooks/pagerduty.py:105: error:
Incompatible types in assignment (expression has type "RestApiV2Client",
variable has type "None")  [assignment]
            self._client = pagerduty.RestApiV2Client(self.token)
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
providers/pagerduty/src/airflow/providers/pagerduty/hooks/pagerduty.py:105: error:
Argument 1 to "RestApiV2Client" has incompatible type "Optional[str]"; expected
"str"  [arg-type]
            self._client = pagerduty.RestApiV2Client(self.token)
                                                     ^~~~~~~~~~
providers/pagerduty/src/airflow/providers/pagerduty/hooks/pagerduty.py:106: error:
Incompatible return value type (got "None", expected "RestApiV2Client") 
[return-value]
            return self._client

Example: https://github.com/apache/airflow/actions/runs/15865684564

Pagerduty seems to have had a breaking change in 2.3.0 which changes some types. Using this opportunity to fix that and bump to 2.3.0

image


^ 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 airflow-core/newsfragments.

@amoghrajesh amoghrajesh changed the title Fix pagerduty mypy Bumping min version of pagerduty to 2.3.0 Jun 25, 2025
@eladkal eladkal merged commit 6735335 into apache:main Jun 25, 2025
70 checks passed
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.

2 participants