Open
Conversation
Introduce paginated_fetch_offset (SCIM startIndex/count) and paginated_fetch_cursor (token-based) helpers in framework/utils.py to eliminate duplicated pagination boilerplate across the codebase.
Replace inline pagination loop in AccountGroupLookup._list_account_groups with the shared paginated_fetch_offset utility, adding proper SCIM offset pagination and deduplication to the previously unpaginated call.
Replace inline cursor-based pagination loop in feature_store_listing with the shared paginated_fetch_cursor utility.
Rewrite multi-line list comprehension as for loop (R8923), prefix unused arguments with underscore (W0613), use implicit booleaness for empty list checks (C1803).
Hatch 1.9.4 does not cap the virtualenv version, and newer virtualenv breaks the propose_interpreters API. Hatch 1.9.7 includes the fix.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4732 +/- ##
==========================================
- Coverage 87.95% 87.78% -0.17%
==========================================
Files 123 123
Lines 17570 17597 +27
Branches 3714 3717 +3
==========================================
- Hits 15453 15448 -5
- Misses 1425 1459 +34
+ Partials 692 690 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
❌ 62/65 passed, 3 failed, 6 skipped, 5h19m49s total ❌ test_some_entitlements[True]: TimeoutError: Timed out after 0:00:10 (2m10.096s)❌ test_running_real_migrate_groups_job: databricks.sdk.errors.sdk.OperationFailed: failed to reach TERMINATED or SKIPPED, got RunLifeCycleState.INTERNAL_ERROR: Task apply_permissions failed with message: Workload failed, see run output for details. (8m19.791s)❌ test_permission_for_files_anonymous_func_migration_api: TimeoutError: Timed out after 0:02:00 (11m24.657s)Running from acceptance #8972 |
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
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).
Upgrades hatch from 1.9.4 to 1.9.7 across all CI workflows to fix virtualenv.discovery.builtin incompatibility that broke environment creation on runners.
Linked issues
Closes #4731
Related to #4730
Functionality
paginated_fetch_offset -- Generic SCIM-style offset pagination (startIndex/count). 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.
feature_store_listing (workspace_access/generic.py) -- Previously had an inline while True / next_page_token loop. Now delegates to paginated_fetch_cursor.
Tests