PagerDuty / pdpyras

Low-level PagerDuty REST/Events API client for Python
MIT License
129 stars 29 forks source link

v4.4.0: Miscellaneous #70

Closed Deconstrained closed 2 years ago

Deconstrained commented 3 years ago

Context

Cleaning up my local branches, I found some useful changes and cherry-picked them into this new branch before deleting the old branches. I also revisited this pull request to address #38.

In this round of changes I hope also to include some documentation updates for covering the basics of maintenance/release.

Summary of changes

* Added new error class :class:`PDHTTPError` for strictly application-level errors (i.e. HTTP responses vs. network errors), inherits from :class:`PDClientError`
* Removed unnecessary dependencies that were hold-outs from Python 2.7 compatibility (deprecated)
* Automatically add square brackets to query parameters that are of list type if the user forgets to do so, per the requirement of using `set filters <https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTU2-filtering#set-filters>`
* Fix bug: the :attr:`PDSession.stagger_cooldown` feature added in version 3.2 only applied to network error/retry; it now applies to all forms of retrial
* Add "update" keyword argument to :attr:`APISession.persist` which changes its behavior to update any existing resource with the provided values in addition to returning the resource as a dictionary object

One that I accidentally purged from existence (and rewrote here) is adding a new parameter to APISession.persist that tells the method to update the object if it already exists.

TODO

Deconstrained commented 2 years ago

Just needs review/approval from someone other than me.