Paginate through Account Groups list request#4730
Closed
pritishpai wants to merge 4 commits into
Closed
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4730 +/- ##
==========================================
- Coverage 87.95% 87.80% -0.15%
==========================================
Files 123 123
Lines 17570 17583 +13
Branches 3714 3717 +3
==========================================
- Hits 15453 15439 -14
- Misses 1425 1456 +31
+ Partials 692 688 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f2f0818 to
8082a7f
Compare
|
❌ 58/59 passed, 1 failed, 5 skipped, 3h46m33s total ❌ test_permission_for_files_anonymous_func_migration_api: TimeoutError: Timed out after 0:02:00 (11m15.883s)Running from acceptance #8968 |
4 tasks
Contributor
Author
|
Functionally superseeded by #4732 |
a0x8o
pushed a commit
to alexxx-db/ucx
that referenced
this pull request
Jun 24, 2026
## Changes Introduce shared pagination utilities in framework/utils.py and refactor all manual raw-API pagination loops to use them, eliminating duplicated boilerplate and reducing the risk of pagination bugs (like the missing pagination that caused customer issues with account groups listing). ### Linked issues Closes databrickslabs#4731 Related to databrickslabs#4730 ### Functionality **paginated_fetch_offset** -- Generic SCIM-style offset pagination (startIndex/count). Accepts a callable with signature `(start_index: int, count: int) -> dict` so callers own query construction. Handles page advancement, empty-page termination, and partial-page detection. **paginated_fetch_cursor** -- Generic cursor/token-based pagination (page_token/next_page_token). Handles token forwarding and missing-token termination. ### Refactored sites **AccountGroupLookup._list_account_groups** (workspace_access/groups.py) -- Previously made a single unpaginated API call. Now uses paginated_fetch_offset with deduplication, matching the pagination logic in the SDK's AccountGroupsAPI.list(). This fixes the root cause where not all account groups were fetched for large accounts. Inner fetch function renamed from fetch_page to fetch_account_groups. **feature_store_listing** (workspace_access/generic.py) -- Previously had an inline while True / next_page_token loop. Now delegates to paginated_fetch_cursor. Inner fetch function renamed from fetch_page to fetch_feature_tables. ### Tests - [ ] manually tested - [x] added unit tests - [ ] added integration tests - [ ] verified on staging environment (screenshot attached) Unit tests added: - Multi-page collection test for feature_store_listing (200 + 50 items across 2 pages) - Deduplication test for _list_account_groups (duplicate group ID across pages counted once)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Customer facing issues where an account group is not matching. This is due to the list account groups not paginating through the API calls. Since it is a bigger change and an account api client is not always available at workspace level, we replicate the sdk pagination here.
Tests