Skip to content

Commit 8392dae

Browse files
[QQC-2944] Remove deprecated project.datasets and dataset.projects methods (#1295)
1 parent 8bb5363 commit 8392dae

File tree

13 files changed

+23
-106
lines changed

13 files changed

+23
-106
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
# Version TBD (Date TBD)
4+
## Removed
5+
* Project.datasets and Datasets.projects methods as they have been deprecated
6+
37
# Version 3.57.0 (2023-11-30)
48
## Added
59
* Global key support for Project move_data_rows_to_task_queue

examples/basics/basics.ipynb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,6 @@
315315
{
316316
"metadata": {},
317317
"source": [
318-
"# Since the project we created only has batches, we can't query for datasets. \n",
319-
"# sample_project_datasets = project.datasets() --> Run if project is in dataset mode\n",
320318
"sample_project_batches = project.batches()\n",
321319
"\n",
322320
"list(sample_project_batches)\n",

examples/basics/datasets.ipynb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,6 @@
138138
"outputs": [],
139139
"execution_count": null
140140
},
141-
{
142-
"metadata": {},
143-
"source": [
144-
"# Attached projects\n",
145-
"print(\"Projects with this dataset attached :\", list(dataset.projects()))\n",
146-
"print(\"Dataset name :\", dataset.name)"
147-
],
148-
"cell_type": "code",
149-
"outputs": [],
150-
"execution_count": null
151-
},
152141
{
153142
"metadata": {},
154143
"source": [

examples/integrations/detectron2/coco_object.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@
550550
" client.get_labeling_frontends(where=lb.LabelingFrontend.name == 'editor'))\n",
551551
"project.setup(editor, labels_mal.get_ontology().asdict())\n",
552552
"project.enable_model_assisted_labeling()\n",
553-
"project.datasets.connect(dataset)"
553+
"project.create_batches_from_dataset(\"batch\", dataset.uid)"
554554
],
555555
"cell_type": "code",
556556
"outputs": [],
@@ -583,4 +583,4 @@
583583
"execution_count": null
584584
}
585585
]
586-
}
586+
}

examples/integrations/detectron2/coco_panoptic.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@
10141014
" for future in tqdm(as_completed(futures)):\n",
10151015
" labels.append(future.result())\n",
10161016
"\n",
1017-
"labels_mea = lb_types.LabelGenerator(labels)\n",
1017+
"labels_mea = lb_types.LabelGenerator(labels)\n",
10181018
"labels_mea.add_url_to_masks(signer) \\\n",
10191019
" .add_url_to_data(signer) "
10201020
],
@@ -1317,7 +1317,7 @@
13171317
" client.get_labeling_frontends(where=lb.LabelingFrontend.name == 'editor'))\n",
13181318
"project.setup(editor, labels_mal.get_ontology().asdict())\n",
13191319
"project.enable_model_assisted_labeling()\n",
1320-
"project.datasets.connect(dataset)\n"
1320+
"project.create_batches_from_dataset(\"batch\", dataset.uid)"
13211321
],
13221322
"cell_type": "code",
13231323
"outputs": [],
@@ -1366,4 +1366,4 @@
13661366
"execution_count": null
13671367
}
13681368
]
1369-
}
1369+
}

examples/integrations/tlt/labelbox_upload.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@
228228
"source": [
229229
"project = client.create_project(name = \"animal_demo_proj\", media_type=lb.MediaType.Image)\n",
230230
"dataset = client.create_dataset(name = \"animal_demo_ds\")\n",
231-
"project.datasets.connect(dataset)\n",
232231
"dataset.create_data_rows(image_paths)\n",
232+
"project.create_batches_from_dataset(\"batch\", dataset.uid)\n",
233233
"project.enable_model_assisted_labeling()"
234234
],
235235
"cell_type": "code",
@@ -272,7 +272,9 @@
272272
{
273273
"metadata": {},
274274
"source": [
275-
"datarows = [dr for dr in list(project.datasets())[0].data_rows()]"
275+
"datarows = []\n",
276+
"for batch in list(project.batches()):\n",
277+
" datarows.extend(list(batch.export_data_rows()))"
276278
],
277279
"cell_type": "code",
278280
"outputs": [],

examples/model_diagnostics/custom_metrics_demo.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@
334334
"\n",
335335
"dataset = client.create_dataset(name=\"Mapillary Diagnostics Demo\")\n",
336336
"print(f\"Dataset Created: {dataset.uid}\")\n",
337-
"project.datasets.connect(dataset)"
337+
"project.create_batches_from_dataset(\"batch\", dataset.uid)"
338338
],
339339
"cell_type": "code",
340340
"outputs": [],
@@ -580,4 +580,4 @@
580580
"execution_count": null
581581
}
582582
]
583-
}
583+
}

examples/model_diagnostics/model_diagnostics_demo.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@
345345
"\n",
346346
"dataset = client.create_dataset(name=\"Mapillary Diagnostics Demo\")\n",
347347
"print(f\"Dataset Created: {dataset.uid}\")\n",
348-
"project.datasets.connect(dataset)"
348+
"project.create_batches_from_dataset(\"batch\", dataset.uid)"
349349
],
350350
"cell_type": "code",
351351
"outputs": [],
@@ -549,4 +549,4 @@
549549
"execution_count": null
550550
}
551551
]
552-
}
552+
}

labelbox/schema/dataset.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ class Dataset(DbObject, Updateable, Deletable):
4444
created_at (datetime)
4545
row_count (int): The number of rows in the dataset. Fetch the dataset again to update since this is cached.
4646
47-
projects (Relationship): `ToMany` relationship to Project
4847
created_by (Relationship): `ToOne` relationship to User
4948
organization (Relationship): `ToOne` relationship to Organization
5049
@@ -56,12 +55,6 @@ class Dataset(DbObject, Updateable, Deletable):
5655
row_count = Field.Int("row_count")
5756

5857
# Relationships
59-
projects = Relationship.ToMany(
60-
"Project",
61-
True,
62-
deprecation_warning=
63-
"This method does not return any data for batch-based projects and it will be deprecated on or around November 1, 2023."
64-
)
6558
created_by = Relationship.ToOne("User", False, "created_by")
6659
organization = Relationship.ToOne("Organization", False)
6760
iam_integration = Relationship.ToOne("IAMIntegration", False,

labelbox/schema/project.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ class Project(DbObject, Updateable, Deletable):
6161
auto_audit_number_of_labels (int)
6262
auto_audit_percentage (float)
6363
64-
datasets (Relationship): `ToMany` relationship to Dataset
6564
created_by (Relationship): `ToOne` relationship to User
6665
organization (Relationship): `ToOne` relationship to Organization
6766
labeling_frontend (Relationship): `ToOne` relationship to LabelingFrontend
@@ -86,12 +85,6 @@ class Project(DbObject, Updateable, Deletable):
8685
media_type = Field.Enum(MediaType, "media_type", "allowedMediaType")
8786

8887
# Relationships
89-
datasets = Relationship.ToMany(
90-
"Dataset",
91-
True,
92-
deprecation_warning=
93-
"This method does not return any data for batch-based projects and it will be deprecated on or around November 1, 2023."
94-
)
9588
created_by = Relationship.ToOne("User", False, "created_by")
9689
organization = Relationship.ToOne("Organization", False)
9790
labeling_frontend = Relationship.ToOne("LabelingFrontend")

0 commit comments

Comments
 (0)