How to paginate runs?

I am using the WandB API to retrieve many runs for a project. I need to get runs in pages to reduce latency. Currently, in the WandB API, I notice that there is a per_page parameter for getting runs, but there is no page parameter. Therefore, I don’t see a clear way to retrieve the next page of runs.

According to the WandB documentation:

    client: "RetryingClient",
    entity: str,
    project: str,
    filters: Optional[Dict[str, Any]] = None,
    order: Optional[str] = None,
    per_page: int = 50,
    include_sweeps: bool = (True)

This seems incomplete to me. If we get 50 runs, what should we do the next 50 runs? Am I overlooking something? It should be something like: get page=2 and per_page=10 runs.

Hi @mahdijafari! thank you for writing in! Looking into it.

Hi @mahdijafari! Apologies for the wait, I’ve checked internally as well as tried a couple of things out myself and it does look like the per_page argument doesn’t have a way to control the actual page you are interested in, and is mostly for getting the n of first runs. I think having what you are suggested as a part of our SDK would be a useful feature, and if you would like to I can submit a feature request for you to our engineering team.

Hi @artsiom ! Thank you for looking into the issue. Yes, I would definitely like to submit a feature request for this to be included in the SDK. It would be really helpful. Thank you!

Thank you for the quick upate! I have submitted your feature request to our engineering team!

1 Like