PagerDuty/pdpyras

Pydras 5.0 throws an error when accessing oncall API

Closed this issue · 5 comments

On python 3.10
https://github.com/PagerDuty/pdpyras/blob/main/pdpyras.py#LL787C1-L790C26
Throws an TypeError: not enough arguments for format string error, because no variable is available to be inserted. Suggest rewriting like

        return (
            f"{endpoint}: Success (status {r.status_code}) but an expectation still " \
            f"failed{context_msg}"
        )

This happens when using the paged request for oncall. e.g.

    user_params = {
        "time_zone": TZ_NAME,
        "since": ts["start"].isoformat(),
        "until": ts["end"].isoformat(),
    }

    oncalls = session.iter_all(
        "oncalls", params=user_params, page_size=MAX_ITEMS)
    final_report_rows = {}
    for o in oncalls:

av1m commented

I open a PR #103.
Check #103, it seems to be the same problem

yup - exact same fix too.

jeffpm commented

Also seeing the error from #103 when hitting the incidents API

We're having the same issue.

Pardon the late response, folks! v5.0.2 has the changes from #103 and a generic fix (this may be more common) is underway.