Skip to content
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

Pydras 5.0 throws an error when accessing oncall API #102

Closed
alexeiser opened this issue May 2, 2023 · 5 comments
Closed

Pydras 5.0 throws an error when accessing oncall API #102

alexeiser opened this issue May 2, 2023 · 5 comments

Comments

@alexeiser
Copy link

alexeiser commented May 2, 2023

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
Copy link
Contributor

av1m commented May 3, 2023

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

@alexeiser
Copy link
Author

yup - exact same fix too.

@jeffpm
Copy link

jeffpm commented May 4, 2023

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

@mvilanova
Copy link

We're having the same issue.

@Deconstrained
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants