-
Notifications
You must be signed in to change notification settings - Fork 4
Fix: add missing Return event ID from change event submission #38
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
Fix: add missing Return event ID from change event submission #38
Conversation
|
@Deconstrained Could you review this when you have time please? |
|
@Deconstrained any chance to review and have bug fix release for this? |
Deconstrained
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@simonprydden @eladkal Hello, and thank you for the pull request.
The API itself no longer returns a JSON with an ID, and so would return None instead (the response body schema is documented here). All Python functions without a return statement return None, which is the same as the default case for the call to dict.get, and so the code should have no functional difference.
Out of curiosity, is there is any hidden case I may be unaware of where the API response schema still contains an id property, and how is it used, or is this purely an issue that comes up in a CI/CD step i.e. some kind of static analysis?
|
I'm forward-porting the fix to 2.0.0 so whichever comes first (fixing the access control issue that is blocking external pull requests or review/approval of #36) will determine if the fix comes as a patch release or new major release. |
|
Hi @Deconstrained, this was picked up in the unit tests in the CI/CD step, but now I'm looking more at the API reference you linked, I think this change might not be correct. Should the docstring for FYI the response for the live server & mock server are different, when I click the send api request button. |
Indeed, thank you for noticing this. I'll update the client documentation as well so it reflects reality. Would it break the Airflow build if the function had an explicit return statement of As for the server side (mock vs live), I'm looking into how to resolve this. |
It's a test that expects it to return an ID. I'll correct the tests to match the return value of none. Lets close this PR, as I don't think it's needed? I was correcting the function to match the docstring, but we should be doing it the other way. |
|
@Deconstrained Has |
The API originally may have had an |
The original issue in #38 was not caused by the lack of a return statement but by the docstring specifying a string-type return value.
The original issue in #38 was not caused by the lack of a return statement but by the docstring specifying a string-type return value.


changing from pdpyras to pagerduty library the return id is missing, the docstring of the function mentions the response ID
https://github.com/PagerDuty/pdpyras/blob/bb0790beb2831129c6ae018470a5e66a7e487611/pdpyras.py#L1475