Skip to content

Conversation

@TordAreStromsnes
Copy link
Contributor

This pull request introduces automatic pagination support to the DSIS API client and updates the documentation to explain how pagination works and how to control it. The main logic for following OData nextLink references and aggregating paged results is now handled transparently when using execute_query(), with an option to disable it for manual pagination. The get() method has also been refactored and moved to the base client class.

The most important changes include:

Pagination Support and API Enhancements

  • Added automatic OData pagination to execute_query() via a new fetch_all parameter (default True). When enabled, the client follows all odata.nextLink references and aggregates results into a single response. Manual pagination is possible by setting fetch_all=False. The logic for aggregating paged results is implemented in the new _aggregate_nextlink_pages helper method. [1] [2] [3]

Client Refactoring

  • Moved the get() method from DSISClient to BaseClient to reduce duplication and improve maintainability. The method was also refactored for clarity and to ensure schema validation is handled in the base class. [1] [2] [3] [4]

Documentation Updates

  • Expanded the Query Builder documentation to explain automatic pagination, the fetch_all parameter, and when to use or disable it. Added a new example demonstrating manual pagination control. [1] [2]

closes #28

Copy link
Collaborator

@Qif-Equinor Qif-Equinor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good and add few comments.

could you add some tests against the new argument ?

Qif-Equinor
Qif-Equinor previously approved these changes Nov 7, 2025
Copy link
Collaborator

@Qif-Equinor Qif-Equinor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update the doc as commented.

@TordAreStromsnes
Copy link
Contributor Author

please update the doc as commented.

I have updated docs to the newer version now, where we use max_pages in stead of fetch all. Not entirely sure what you mean by "Class should be used here."? , @Qif-Equinor

@TordAreStromsnes TordAreStromsnes merged commit c4e5766 into main Nov 10, 2025
5 checks passed
@TordAreStromsnes TordAreStromsnes deleted the feature/get-all-data-from-an-endpoint branch November 10, 2025 08:28
TordAreStromsnes pushed a commit that referenced this pull request Nov 10, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.3.0](v0.2.1...v0.3.0)
(2025-11-10)


### Features

* add automatic pagination support to DSIS API client
([#29](#29))
([c4e5766](c4e5766)),
closes [#28](#28)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

Add automatic pagination to execute_query

3 participants