Skip to content

Commit 06008a3

Browse files
committed
Fix Paginator dropping results on empty token pages
The Paginator stopped iterating at the first empty page even when the response carried a non-empty next_page_token, silently dropping results on later pages. Token-paginated list methods (e.g. tables().list()) can return empty intermediate pages with a valid token, so results could be under-returned. Replace the public Paginator constructor with two explicit factories: - Paginator.newTokenPagination: iterate until nextPageFn returns null; empty pages are skipped, not treated as the end of results. - Paginator.newOffsetPagination: stop on the first empty page (offset, SCIM and legacy SQL APIs have no token and rely on this). The constructor is now private, so every call site states its strategy. Regenerate all *API.java list methods to the appropriate factory. Update hand-written APIs: SharesExtAPI -> newTokenPagination; SCIM Users/Groups/ServicePrincipals (and Account* variants) -> newOffsetPagination. Signed-off-by: Hector Castejon Diaz <hector.castejon@databricks.com>
1 parent f8c4aa7 commit 06008a3

125 files changed

Lines changed: 353 additions & 181 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

NEXT_CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66

77
### Breaking Changes
88

9+
* The public `Paginator` constructor in `com.databricks.sdk.support` has been replaced by the `Paginator.newTokenPagination(...)` and `Paginator.newOffsetPagination(...)` factory methods, which make the pagination strategy explicit. Code that constructed `Paginator` directly must switch to one of these factories.
10+
911
### Bug Fixes
1012

13+
* Fixed `Paginator` silently dropping results when a token-paginated response returned an empty page with a non-empty `next_page_token`. List methods (e.g. `tables().list()`) now keep paging until the page token is absent instead of stopping at the first empty page.
14+
1115
### Security Vulnerabilities
1216

1317
### Documentation

databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppsAPI.java

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppsSettingsAPI.java

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks-sdk-java/src/main/java/com/databricks/sdk/service/billing/BudgetPolicyAPI.java

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks-sdk-java/src/main/java/com/databricks/sdk/service/billing/BudgetsAPI.java

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks-sdk-java/src/main/java/com/databricks/sdk/service/billing/LogDeliveryAPI.java

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundle/BundleAPI.java

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/AccountMetastoreAssignmentsAPI.java

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/AccountMetastoresAPI.java

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/AccountStorageCredentialsAPI.java

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)