Skip to content

Add support to assign multiple datarows to a user#2054

Merged
midhun-pm merged 6 commits intodevelopfrom
bulk_assign_datarows
Apr 28, 2026
Merged

Add support to assign multiple datarows to a user#2054
midhun-pm merged 6 commits intodevelopfrom
bulk_assign_datarows

Conversation

@midhun-pm
Copy link
Copy Markdown
Contributor

@midhun-pm midhun-pm commented Apr 27, 2026

Description

https://www.loom.com/share/1fd2774a6e2b4138ad9f453c95379076

Summary

  • Add bulk_assign_data_rows() method to the Project class, calling the existing bulkAssignDataRows GraphQL mutation
  • Add TaskAssignmentStatus enum (FREE, RESERVED) for filtering which data rows can be assigned
  • Export TaskAssignmentStatus from the top-level labelbox package

Usage

from labelbox import Client, TaskAssignmentStatus

client = Client(api_key="<your_api_key>")
project = client.get_project("<project_id>")

# Assign data rows to a labeler (only unassigned rows by default)
project.bulk_assign_data_rows(
    user_id="<user_id>",
    data_row_ids=["<data_row_id_1>", "<data_row_id_2>"],
)

# Optionally allow reassigning already-reserved rows
project.bulk_assign_data_rows(
    user_id="<user_id>",
    data_row_ids=["<data_row_id_1>"],
    allowed_statuses=[TaskAssignmentStatus.FREE, TaskAssignmentStatus.RESERVED],
)

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Document change (fix typo or modifying any markdown files, code comments or anything in the examples folder only)

All Submissions

  • Have you followed the guidelines in our Contributing document?
  • Have you provided a description?
  • Are your changes properly formatted?

New Feature Submissions

  • Does your submission pass tests?
  • Have you added thorough tests for your new feature?
  • Have you commented your code, particularly in hard-to-understand areas?
  • Have you added a Docstring?

Changes to Core Features

  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Have you updated any code comments, as applicable?

Note

Medium Risk
Adds a new Project.bulk_assign_data_rows GraphQL mutation wrapper and new public enum, plus updates CI to use different staging API key secret names; main risk is API/permission mismatches or CI failures due to secret configuration changes.

Overview
Adds bulk data-row assignment to the Python SDK via Project.bulk_assign_data_rows, calling the bulkAssignDataRows GraphQL mutation with optional allowed_statuses filtering.

Introduces and exports TaskAssignmentStatus (FREE, RESERVED), and adds unit + integration tests covering request serialization, empty-input behavior, and status filtering.

Also refactors ApiKey.create_api_key to run validity/time-unit/role input validation earlier (tests updated accordingly), tightens typing in DataRowItemBase.build, and updates GitHub Actions workflow/action matrices to use new staging API key secret identifiers.

Reviewed by Cursor Bugbot for commit 3be99b7. Bugbot is set up for automated code reviews on this repo. Configure here.

@midhun-pm midhun-pm marked this pull request as ready for review April 27, 2026 15:16
@midhun-pm midhun-pm requested a review from a team as a code owner April 27, 2026 15:16
@midhun-pm midhun-pm merged commit 9e3a274 into develop Apr 28, 2026
16 of 26 checks passed
@midhun-pm midhun-pm deleted the bulk_assign_datarows branch April 28, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants