Commit d900084
committed
Fix Paginator dropping results on empty pages (DECO-27280)
The Paginator stopped iterating on the first page that returned zero
items, even when that page carried a non-empty next_page_token. Token-
paginated calls such as tables().list(...) could silently return no
results when leading pages were empty but more results lived on later
pages.
flipNextPage now continues past empty pages and terminates only when
nextPageFn returns null (or the response is null), establishing the
contract: nextPageFn returns null exactly when there are no more pages.
Offset-based pagination (the SCIM IAM list APIs and redash 1-based list
APIs) previously relied on the Paginator stopping on an empty page and
never returned null, so the offset lambdas are updated to return null on
an empty page; otherwise they would loop forever. These generated files
are produced by the SDK codegen template, which is updated in
databricks-eng/universe-dev#11878; the edits here are reproduced on the
next regeneration.
Adds PaginatorTest covering empty leading/interleaved pages, offset
termination, forward-progress fetch counts, the absence of a built-in
loop guard, and error propagation.
Co-authored-by: Isaac1 parent 4d195ac commit d900084
14 files changed
Lines changed: 398 additions & 12 deletions
File tree
- databricks-sdk-java/src
- main/java/com/databricks/sdk
- service/iam
- support
- test/java/com/databricks/sdk/support
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
| |||
Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| |||
Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| |||
Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments