Repository navigation
Add label version history methods (PLT-4661) - #2086
Merged
Merged
Conversation
Labelbox now records a version of a label at each hand-off (submit or save from the editor, review approve/reject, rework submit, move into rework), readable through the labelVersions / labelVersion GraphQL queries. This adds them to the SDK: - Project.label_versions(label=, data_row=, created_by=, created_after=, created_before=, include_annotations=, page_size=) - Label.versions(include_annotations=) - Client.get_label_version(version_id, include_annotations=) - Typed LabelVersion / LabelVersionStage and the LabelVersionAction enum, exported from labelbox and listed in the Sphinx docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mnoszczak
requested review from
KeshavSahoo,
StepanTytaLabelbox,
carl-l-chua,
gmadaan-hue,
kjamrozy,
pablito25sp and
ramy1951
October 19, 2026 09:22
Pillow 13 rejects Image.fromarray(bool_array, "L") with "Invalid mode for data type", which fails tests/data/serialization/ndjson/test_image.py on Python 3.11+ (they now resolve Pillow 13). Converting the bool mask to uint8 first produces byte-identical PNGs on Pillow 12 and works on 13. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pawelkozik-labelbox
approved these changes
Oct 19, 2026
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.
PLT-4661
API: Labelbox/intelligence#31624 (the
labelVersions/labelVersionGraphQL queries this calls). Merge after that PR is deployed.Description
Labelbox records a version of a label at each hand-off: a submit or save from the editor, a review approve/reject, a rework submit, a move into rework. Each version has who made the hand-off, when, in which workflow step, and the label's annotations at that moment. Autosaves and drafts record none, and versions are never changed or deleted. Recording is enabled per project (
label-version-history), and there are no versions from before it was enabled. Airbnb asked for this to compute IAA/ARA/RAA and audit QA (packet AN-3).What's added:
Project.label_versions(label=None, data_row=None, created_by=None, created_after=None, created_before=None, include_annotations=True, page_size=100). Filters take IDs or SDK objects. Times take adatetime(naive ones are read as UTC) or an ISO 8601 string. A bad page size or an empty time range raisesValueErrorbefore any request.Label.versions(include_annotations=True)andClient.get_label_version(version_id, include_annotations=True).LabelVersion:id,label_id,data_row_id,project_id,action,created_at,created_by_id,stage,annotation_count,label,label_json.LabelVersionStage:task_queue_id,name,type.LabelVersionAction:SUBMITTED,SAVED,APPROVED,REJECTED,REWORK_SUBMITTED,SENT_TO_REWORK. Unknown actions are kept as strings.PaginatedCollectionfollows it as you iterate.labelboxand listed in the Sphinx docs (label-version.rst). The version and changelog are left to the Prep PR.Readable by whoever can read the labels:
AuthorizationError.End-to-end evidence
This branch's SDK against the intelligence PR's API, running locally on :8661. The workflow is Labeling → Review 1 → Audit → Done, with rejects going to Rework. The versions come from real editor/review hand-offs (see the API PR):
Tests
tests/unit/schema/test_label_version.py: 16 tests. They cover:label_json;include_annotations=Falseleaving the content fields out of the query;labelJsonsent as text;ValueErrorfor a bad page size, an empty or unreadable time range, and an empty ID;get_label_versionreturning a version orNone;Project,LabelandCliententry points.Results:
pytest tests/unit: 471 passed. The one collection error istest_label_data_type.py, which needs thedataextra (numpy) that isn't in my environment.mypy src: clean.ruff check/ruff format --check(ruff 0.9, as rye pins): clean.CI note (not this change):
unit-datafails on Python 3.11–3.13 intests/data/serialization/ndjson/test_image.py::test_mask*withValueError: Invalid mode for data type. This run resolved the newpillow==13.0.0; develop's last green run (Oct 16) used12.3.0. I reproduced the error locally with Pillow 13 on this branch's untouched mask code.unit(474 passed),lintandintegrationpass on every version. Follow-up: pinpillow<13or adaptImage.fromarrayfor Pillow 13.🤖 Generated with Claude Code