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

client.datasets() returns only results from the first page of the response. #8

Open
shaimarvinblue opened this issue Dec 10, 2024 · 2 comments

Comments

@shaimarvinblue
Copy link

client.datasets() returns only results from the first page of the response.

when sending a request that results in a long response only the first page is returned unless page=2 for instance is transferred as *kwargs, then you would get the specified page. however there is no way of knowing before hand how many pages will be returned. some sort of pagination mechanism is needed.

    response = client.datasets(
        simulation_round="ISIMIP3b",
        product="InputData",
        climate_forcing=["gfdl-esm4"],
        climate_scenario=["historical", "ssp126", "ssp370"],
        climate_variable=["hurs", "sfcwind", "tasmax", "tasmin", "rsds", "pr"]
@jochenklar
Copy link
Member

Hi @shaimarvinblue , I could add a mechanism to retrieve all pages before returning. I think I would need some kind of limit though. Would that match your expectation?

What you already can do is to user page_size=20 or page=2 to control the pagination.

@shaimarvinblue
Copy link
Author

shaimarvinblue commented Dec 10, 2024

yes I guess inputing something like page_size=20000 would work for me now. however a pagination method would be nice as for the current state you are unable to know easily that there where more files in the next page.
Thanks for the super fast response

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

2 participants