Repository navigation
Add user group and member organization filters to workspace performance reports - #2081
Merged
manuaero merged 1 commit intoOct 14, 2026
Conversation
…ce reports Client.get_workspace_performance_metric() and Client.get_workspace_labeler_performance() take user_group_ids and member_organization_ids, which the REST API now accepts on both workspace endpoints. Rows of the three performance tables carry member_organization_id and member_organization_name, and a workspace series echoes member_organization_ids and user_group_ids. Iterating a performance table now raises PerformanceTableChangedError when a page reports a different total from the first page. Under a user group filter, group membership is worked out for every page, so a member joining or leaving mid-read shifts the rows; before, the SDK returned them without saying so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
manuaero
requested review from
cyrusj89,
gramos-lb,
john-labelbox,
labelbox-engineering,
ramy1951,
snmodi21 and
vikram-kharvi
October 14, 2026 04:50
manuaero
deleted the
feat/performance-workspace-groups-and-member-organizations
branch
October 14, 2026 05:02
Merged
This branch was previously deployed
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.
Description
The Performance REST API's two workspace reports now take a user group filter and a member organization filter, and its member tables say which organization each member's account belongs to (Labelbox/intelligence#31561, deployed to production). This adds them to the SDK methods from #2078. No ticket.
What changes:
Client.get_workspace_performance_metric()andClient.get_workspace_labeler_performance():user_group_ids(up to 25 groups of the caller's organization, at most 5,000 members between them) andmember_organization_ids(up to 100). Both take IDs or SDK objects, and an empty list raisesValueError, as the existing filters do. They are appended after the existing keyword arguments, so positional calls are unchanged.ProjectLabelerPerformance,ProjectReviewerPerformanceandWorkspaceLabelerPerformance:member_organization_idandmember_organization_name(masked asorg.name.<id>where the caller may not see it). Both default toNone, so a reply without them still parses.PerformanceMetricSeries:member_organization_idsanduser_group_ids, the filters a workspace series was given.PerformanceRowsnow raises the newPerformanceTableChangedError(aLabelboxError, exported fromlabelbox) when a page reports a differenttotalfrom the first page, instead of returning rows that can miss or repeat one. This applies to every performance table, since a project table is also read one request per page. A join and a leave between the same two pages leavetotalunchanged and cannot be seen; thePerformanceRowsdocstring says so. This is the one change in behaviour for existing callers; it goes under Changed in the release notes.InvalidQueryError.Checked against production
The branch's methods were run against production with a real API key (counts printed, no names or IDs):
totalmatching the rows read; the same group in upper case gave the same total; the metric echoeduser_group_ids.PerformanceTableChangedErrorfiring.member_organization_idsreturned only rows of that organization, and the metric echoed it.member_organization_id.ValueErrorbefore any request; 26 groups raisedInvalidQueryErrornaminguserGroupIds; an unknown group returned an empty table.The weekly metric under a group filter came out 5 labels above the table's total. The same gap exists with no filter at all (71 labels on the whole workspace), so it is a property of the Monitor's chart and table and not of this change.
Tests
tests/unit/schema/test_performance.py: the filters are sent under the API's names and only when given; empty lists are refused;UserGroupand other SDK objects are accepted; the echoes and row fields are parsed, includingnulland a reply that leaves them out; the over-5,000-members400is raised asInvalidQueryErrornaming the parameter; atotalthat changes between pages raisesPerformanceTableChangedError, on a project table and on a group-filtered workspace table. All 100 tests in the file pass, andruff format,ruff checkandmypyare clean on the changed files.Before opening, the change and the docs were reviewed against the API's code by four independent reviewers, with every finding checked by two more. The 18 upheld findings (wording, an over-strong paging promise, the version note in the guide) are fixed here, and the fixes were checked again.
The user-facing guide is updated in Labelbox/lbx-docs-mintlify#297, to merge once 7.14.0 is on PyPI. Release as 7.14.0 after this merges.
Type of change
All Submissions
New Feature Submissions
Changes to Core Features
🤖 Generated with Claude Code
Note
Medium Risk
New optional filters are additive, but existing callers iterating large performance tables may now hit PerformanceTableChangedError if totals change between pages—a deliberate behavior change for data consistency.
Overview
Workspace performance APIs gain
user_group_idsandmember_organization_idsfilters onget_workspace_performance_metricandget_workspace_labeler_performance, wired through to the REST query params and echoed onPerformanceMetricSeries.Labeler/reviewer/workspace performance rows now include
member_organization_idandmember_organization_nameso callers can attribute work to vendor orgs.Behavior change: paginated
PerformanceRowsiteration raises the new exportedPerformanceTableChangedErrorwhen a later page’stotaldisagrees with the first page, instead of silently duplicating or skipping rows when reports shift mid-read (notably under user-group filters). Docstrings and Sphinx docs are updated accordingly.Reviewed by Cursor Bugbot for commit 4220c5a. Bugbot is set up for automated code reviews on this repo. Configure here.