Pydras 5.0 throws an error when accessing oncall API
Closed this issue · 5 comments
alexeiser commented
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:
alexeiser commented
yup - exact same fix too.
mvilanova commented
We're having the same issue.
Deconstrained commented
Pardon the late response, folks! v5.0.2 has the changes from #103 and a generic fix (this may be more common) is underway.