Skip to content

[PLT-2437][PLT-2438] Disable python sdk version in tests and deprecate label parameters #1955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/python-package-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,15 @@ jobs:
- python-version: "3.9"
api-key: STAGING_LABELBOX_API_KEY_3
da-test-key: DA_GCP_LABELBOX_API_KEY
sdk-version: ${{ fromJson(needs.get_sdk_versions.outputs.sdk_versions)[3] }}
- python-version: "3.10"
api-key: STAGING_LABELBOX_API_KEY_4
da-test-key: DA_GCP_LABELBOX_API_KEY
sdk-version: ${{ fromJson(needs.get_sdk_versions.outputs.sdk_versions)[2] }}
- python-version: "3.11"
api-key: STAGING_LABELBOX_API_KEY
da-test-key: DA_GCP_LABELBOX_API_KEY
sdk-version: ${{ fromJson(needs.get_sdk_versions.outputs.sdk_versions)[1] }}
- python-version: "3.12"
api-key: STAGING_LABELBOX_API_KEY_5
da-test-key: DA_GCP_LABELBOX_API_KEY
sdk-version: ${{ fromJson(needs.get_sdk_versions.outputs.sdk_versions)[0] }}
da-test-key: DA_GCP_LABELBOX_API_KEY
- python-version: "3.13"
api-key: STAGING_LABELBOX_API_KEY_2
da-test-key: DA_GCP_LABELBOX_API_KEY
Expand Down
3 changes: 0 additions & 3 deletions libs/labelbox/src/labelbox/orm/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ class Field:
These `Comparison` objects can then be used for filtering:
>>> project = client.get_projects(comparison)

Also exposes the ordering property used for sorting:
>>> labels = project.labels(order_by=Label.label.asc)

Attributes:
field_type (Field.Type): The type of the field.
name (str): name that the attribute has in client-side Python objects
Expand Down
7 changes: 7 additions & 0 deletions libs/labelbox/src/labelbox/schema/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,13 @@ def labels(self, datasets=None, order_by=None) -> PaginatedCollection:
"""
Label = Entity.Label

if datasets or order_by:
warnings.warn(
"The datasets and order_by arguments are deprecated and will be removed in the next major release.",
DeprecationWarning,
stacklevel=2,
)

if datasets is not None:
where = " where:{dataRow: {dataset: {id_in: [%s]}}}" % ", ".join(
'"%s"' % dataset.uid for dataset in datasets
Expand Down
11 changes: 0 additions & 11 deletions libs/labelbox/tests/integration/test_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,6 @@ def test_label_update(configured_project_with_label):
assert label.label == "something else"


def test_label_filter_order(configured_project_with_label, label_helpers):
project, _, _, label = configured_project_with_label

project.create_label()
label_helpers.wait_for_labels(project, 2)

list_asc = list(project.labels(order_by=Label.created_at.asc))
list_desc = list(project.labels(order_by=Label.created_at.desc))
assert list_asc == list_desc[::-1]


def test_label_bulk_deletion(configured_project_with_label):
project, _, _, _ = configured_project_with_label

Expand Down
Loading