Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
881e12e
mark AttachmentType.TEXT as deprecated
attila-papai Jun 23, 2023
cb39774
add is_adv_enabled fixture
attila-papai Jun 23, 2023
dc5de9c
add created_data_rows property to Task
attila-papai Jun 23, 2023
bca437d
Update docs
mnoszczak Jun 27, 2023
bbb81bc
Allow SDK tests to run against staging eu
Jun 30, 2023
98e1258
Allow SDK tests to run against staging eu (#1165)
kkim-labelbox Jun 30, 2023
4792c58
added ontology methods to update features in an ontology
Jul 5, 2023
c7aca43
[X-0] Update export v2 docs to include batch_id (#1157)
kkim-labelbox Jul 5, 2023
0656ebc
Included ontology CRUD methods (#1167)
kkim-labelbox Jul 5, 2023
aa8d194
[X-0] Improve exports error handling (#1160)
mnoszczak Jul 6, 2023
efd45d6
[X-0] Improve Task test coverage (#1168)
mnoszczak Jul 11, 2023
fdd35bf
updates to metadata notebook
Jul 11, 2023
74604bd
zeke edits to data row metadata notebook
zeke-emerson Jul 12, 2023
31337f2
latest updates
Jul 12, 2023
b6ded55
updates to metadata notebook (#1170)
kkim-labelbox Jul 12, 2023
c8bd357
replace TEXT with RAW_TEXT
attila-papai Jul 13, 2023
a4e974c
latest update
Jul 14, 2023
55d0ab3
fix up some metadata test cases for ADV
attila-papai Jul 17, 2023
f239126
SN-69 (#1172)
kkim-labelbox Jul 17, 2023
60c5516
Convert all project queue_mode from DATASET to BATCH
Jul 5, 2023
ad6f30d
Replace logic attaching dataset to a project with the one to create a…
Jul 5, 2023
0c34f33
test results
attila-papai Jul 19, 2023
f210b7d
Merge branch 'develop' into attila/AL-6155-fix-sdk-tests-adv
attila-papai Jul 24, 2023
c9381d1
yapf
attila-papai Jul 24, 2023
b4fe014
revert
attila-papai Jul 24, 2023
4da82b7
yapf
attila-papai Jul 24, 2023
8bfb815
Fixed a number of tests (see below)
Jul 11, 2023
dd1d19a
Fix set_labeling_parameter_overrides to not change number of labels
Jul 11, 2023
5edd6c8
Fixed fixture
Jul 12, 2023
fee0cd4
Delete test reviews
Jul 12, 2023
313979e
Fixed failing tests (reasons do not seem directly connected to projec…
Jul 19, 2023
d92f165
Reduce number of test data rows 250 --> 2 for test_batch
Jul 21, 2023
18cc5e8
Set media type for a project
Jul 21, 2023
c22d838
Move test datarow to our own test artifacts bucket
Jul 21, 2023
f51322c
Cleanup / PR feedback
Jul 21, 2023
867a3e4
Add tests to make sure legacy project creation is not allowed but leg…
Jul 24, 2023
0a8d2d6
Add deprecation warnings
Jul 25, 2023
55a2c97
Make test_legacy exception assertion compatible with python 3.7
Jul 25, 2023
0886cd1
Trigger test run
Jul 25, 2023
96dc765
[AL-6476] Integration tests: convert all project queue_mode from DATA…
vbrodsky Jul 25, 2023
cfc3a88
Pass graphql_name to Relantionship
Jul 4, 2023
d50e5b2
Add data_rows() method to Dataset to fetch via cursor
Jul 5, 2023
5c69da8
Add support for data_rows via cursor
Jul 6, 2023
dcdffb4
Remove legacy data_rows relationship
Jul 10, 2023
ebda9df
Make page size Int, not PageSize
Jul 10, 2023
2c6172e
Add ability to customize page size for cursor pagination
Jul 13, 2023
830882f
Fix type for params in PaginatedCollection
Jul 13, 2023
0db2e18
Add support for 'where'
Jul 13, 2023
9b37ee3
Support for orderBy
Jul 13, 2023
59a8d86
Revert where parameter to use Entity
Jul 13, 2023
1524e09
Add utility methods to query to parse where and order_by clauses
Jul 14, 2023
e817986
Remove support for order_by since we are always ordering by cursor
Jul 14, 2023
cb69733
use wait_for_data_row_processing to get updates on data row
Jul 26, 2023
5cb831e
fix format
Jul 26, 2023
22f4082
Merge branch 'develop' into attila/AL-6155-fix-sdk-tests-adv
attila-papai Jul 26, 2023
7db86b4
remove comments
attila-papai Jul 26, 2023
55cf65c
remove comments
attila-papai Jul 26, 2023
e132a54
fix test
Jul 26, 2023
0a4d472
tweaks
Jul 26, 2023
5468cc8
fix format
Jul 26, 2023
4b32d65
fix format take 2
Jul 26, 2023
4f1419f
fix format take 3
Jul 26, 2023
2ecf02d
Refactor graphql parameter handling
Jul 26, 2023
949c4c4
tweaks
Jul 26, 2023
e4f8a5b
fix format
Jul 26, 2023
26f3cc2
[AL-6504] - use wait_for_data_row_processing to get updates on data r…
Jul 26, 2023
9900692
make is_adv_enabled fixture session scoped
attila-papai Jul 28, 2023
e100255
fix asserts
attila-papai Jul 28, 2023
f2eac0b
fix test by adding sleep
attila-papai Jul 28, 2023
75bcc14
[AL-6155] [AL-6724] [AL-6738] Fix some test cases for ADV enabled acc…
attila-papai Jul 28, 2023
ed5153a
fix test by adding sleep
attila-papai Jul 28, 2023
895ff2a
[AL-6294] Support cursor-based pagination for dataset.data_rows() (#1…
vbrodsky Jul 28, 2023
b2749c4
[AL-6732] fix test by adding sleep (#1178)
attila-papai Jul 31, 2023
df9e5f0
fix assert
attila-papai Jul 31, 2023
41107cc
assert if list before asserting its length
attila-papai Jul 31, 2023
2116167
Add ability to use data rows ids instead of the whole data row object…
Jul 27, 2023
f055052
[AL-6305] Add ability to use data rows ids instead of the whole data …
vbrodsky Jul 31, 2023
a5cf49a
[EF-369] Add roles to project members qgl query
Jul 27, 2023
cb11f72
[AL-6726] fix assert message (#1181)
attila-papai Aug 1, 2023
888db37
[SE-2960] Add roles to project members qgl query (#1179)
Aug 1, 2023
87567fe
Support for setting a 'from cursor for dataset.data_rows()
Aug 1, 2023
cc8eed7
[AL-6294] | Bug Fix | Support for setting a 'from cursor for dataset.…
vbrodsky Aug 2, 2023
7ab6b53
fix assert message
attila-papai Aug 3, 2023
714dd4c
fix assert message
attila-papai Aug 3, 2023
6cdf7f4
fix assert for ADV
attila-papai Aug 3, 2023
0d37fc6
Add support for llm media types
lgluszek Aug 3, 2023
3c9a3f3
add return type to get_project
attila-papai Aug 3, 2023
6af82d2
Order MediaType items alphabetically
Aug 3, 2023
482237b
Add LLM media types to unsupported ones
Aug 3, 2023
406e657
Correct formatting
Aug 3, 2023
7ba12ab
Update unsupported media type names
lgluszek Aug 3, 2023
d095424
[AL-6741] fix assert message for ADV (#1190)
attila-papai Aug 3, 2023
4715db5
[AL-6724] fix assert for ADV (#1191)
attila-papai Aug 3, 2023
358239a
Remove new entries in unsupported members
lgluszek Aug 3, 2023
494898c
Exclude LLM media types from tests
lgluszek Aug 3, 2023
22ed9b5
[PTDT-1552] Add LLM media types (#1192)
kkim-labelbox Aug 3, 2023
c5105ef
Add CODEOWNERS (#1193)
kkim-labelbox Aug 4, 2023
32ad868
[Snyk] Security upgrade requests from 2.22.0 to 2.31.0 (#1102)
labelbox-engineering Aug 4, 2023
6abd310
prep release 3.50.0 (#1196)
yamini-labelbox Aug 4, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
mypy -p labelbox --pretty --show-error-codes
- name: Install package and test dependencies
run: |
pip install tox==3.18.1
pip install tox==3.18.1 pytest-snapshot

# TODO: replace tox.ini with what the Makefile does
# to make sure local testing is
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# Changelog
# Version 3.50.0 (2023-08-04)
## Added
* Support batch_ids filter for projects in Exports v2
* Added access_from field to project members to differentiate project-based roles from organization level roles
* Ability to use data_row_ids instead of the whole data row object for DataRow.export_V2()
* Cursor-based pagination for dataset.data_rows()

## Fixed
* client.get_projects() unable to fetch details for LLM projects

## Notebooks
* Improved the documentation for `examples/basics/custom_embeddings.ipynb`
* Updated the documentation for `examples/basics/data_row_metadata.ipynb`
* Added details about CRUD methods to `examples/basics/ontologies.ipynb`

# Version 3.49.1 (2023-06-29)
## Fixed
* Removed numpy version lock that caused Python version >3.8 to download incompatible numpy version
Expand Down
3 changes: 3 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SDK team's approval is required for all code changes (excluding notebook changes)
* @Labelbox/data-io
*.ipynb
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.9-slim-bullseye

RUN pip install pytest pytest-cases pytest-rerunfailures
RUN pip install pytest pytest-cases pytest-rerunfailures pytest-snapshot
RUN apt-get -y update
RUN apt install -y libsm6 \
libxext6 \
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ test-staging: build-image
-e LABELBOX_TEST_API_KEY_STAGING=${LABELBOX_TEST_API_KEY_STAGING} \
local/labelbox-python:test pytest $(PATH_TO_TEST)

test-staging-eu: build-image
docker run -it --rm -v ${PWD}:/usr/src -w /usr/src \
-e LABELBOX_TEST_ENVIRON="staging-eu" \
-e DA_GCP_LABELBOX_API_KEY=${DA_GCP_LABELBOX_API_KEY} \
-e LABELBOX_TEST_API_KEY_STAGING_EU=${LABELBOX_TEST_API_KEY_STAGING_EU} \
local/labelbox-python:test pytest $(PATH_TO_TEST)

test-prod: build-image
docker run -it --rm -v ${PWD}:/usr/src -w /usr/src \
-e LABELBOX_TEST_ENVIRON="prod" \
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
copyright = '2021, Labelbox'
author = 'Labelbox'

release = '3.49.1'
release = '3.50.0'

# -- General configuration ---------------------------------------------------

Expand Down
66 changes: 37 additions & 29 deletions examples/basics/custom_embeddings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"metadata": {},
"source": [
"# Documentation\n",
"Please read this document before getting started. \n",
"Please read this document before getting started.\n",
"https://docs.google.com/document/d/1C_zZFGNjXq10P1MvEX6MM0TC7HHrkFOp9BB0P_S_2MQ"
],
"cell_type": "markdown"
Expand All @@ -46,7 +46,6 @@
{
"metadata": {},
"source": [
"# labelbox\n",
"!pip3 install -q \"labelbox[data]\""
],
"cell_type": "code",
Expand All @@ -56,7 +55,7 @@
{
"metadata": {},
"source": [
"import labelbox as lb \n",
"import labelbox as lb\n",
"import numpy as np\n",
"import json"
],
Expand All @@ -74,7 +73,6 @@
{
"metadata": {},
"source": [
"# for custom embeddings\n",
"!pip3 install -q 'git+https://github.com/Labelbox/advlib.git'"
],
"cell_type": "code",
Expand Down Expand Up @@ -115,9 +113,10 @@
"source": [
"# get images from a Labelbox dataset\n",
"# Our systems start to process data after 1000 embeddings of each type, for this demo make sure your dataset is over 1000 data rows\n",
"dataset = client.get_dataset(\"<ADD YOUR DATASET ID>\")\n",
"dataset = client.get_dataset(\"<ADD YOUR DATASET ID>\") \n",
"drs = list(dataset.export_data_rows(timeout_seconds=9999))\n",
"data_row_ids = [dr.uid for dr in drs]"
"data_row_ids = [dr.uid for dr in drs]\n",
"data_row_ids = data_row_ids[:1000] # keep the first 1000 examples for the sake of this demo"
],
"cell_type": "code",
"outputs": [],
Expand All @@ -127,19 +126,19 @@
"metadata": {},
"source": [
"# Create the payload for custom embeddings\n",
"It should be a .ndjson file\n",
"It does not have to be created through python."
"It should be a .ndjson file. \n",
"Every line is a json file that finishes with a \\n character. \n",
"It does not have to be created through python. "
],
"cell_type": "markdown"
},
{
"metadata": {},
"source": [
"\n",
"\n",
"nb_data_rows = len(data_row_ids)\n",
"# generate 1000 custom embedding vectors, of dimension 2048 each\n",
"# Labelbox supports custom embeddings of dimension up to 2048\n",
"print(\"Number of data rows: \", nb_data_rows)\n",
"# generate random vectors, of dimension 2048 each\n",
"# Labelbox supports custom embedding vectors of dimension up to 2048\n",
"custom_embeddings = [list(np.random.random(2048)) for _ in range(nb_data_rows)]"
],
"cell_type": "code",
Expand All @@ -149,7 +148,7 @@
{
"metadata": {},
"source": [
"# create the ndjson payload for custom embeddings\n",
"# create the payload for custom embeddings\n",
"payload = []\n",
"for data_row_id,custom_embedding in zip(data_row_ids,custom_embeddings):\n",
" payload.append({\"id\": data_row_id, \"vector\": custom_embedding})\n",
Expand All @@ -163,19 +162,28 @@
{
"metadata": {},
"source": [
"# convert payload to ndjson file\n",
"# delete any pre-existing file\n",
"import os\n",
"if os.path.exists(\"payload.ndjson\"):\n",
" os.remove(\"payload.ndjson\")\n",
"\n",
"# convert the payload to json file\n",
"with open('payload.ndjson', 'w') as f:\n",
" sanity_check_payload = json.dump(payload, f)\n",
"\n",
"\n",
" for p in payload:\n",
" f.write(json.dumps(p) + \"\\n\")\n",
" # sanity_check_payload = json.dump(payload, f)"
],
"cell_type": "code",
"outputs": [],
"execution_count": null
},
{
"metadata": {},
"source": [
"# sanity check that you can read/load the file and the payload is correct\n",
"with open('payload.ndjson') as f:\n",
" sanity_check_payload = json.load(f)\n",
" \n",
"\n",
"print(\"Nb of custom embedding vectors in sanity_check_payload: \", len(sanity_check_payload))\n",
"# print(\"sanity_check_payload: \", sanity_check_payload)"
" sanity_check_payload = [json.loads(l) for l in f.readlines()]\n",
"print(\"Nb of custom embedding vectors in sanity_check_payload: \", len(sanity_check_payload))"
],
"cell_type": "code",
"outputs": [],
Expand All @@ -184,7 +192,7 @@
{
"metadata": {},
"source": [
"# See all custom embeddings available\n",
"# See all custom embeddings available in your Labelbox workspace\n",
"!advtool embeddings list"
],
"cell_type": "code",
Expand All @@ -194,9 +202,9 @@
{
"metadata": {},
"source": [
"# # Create a new custom embedding\n",
"# # Create a new custom embedding, unless you want to re-use one\n",
"!advtool embeddings create my_custom_embedding_2048_dimensions 2048\n",
"# will return the ID of the newly created embedding, e.g. cgbjjt5ra07710005liytdf19"
"# this command will return the ID of the newly created embedding, e.g. ciqtgd94607290000ljx4dvh2"
],
"cell_type": "code",
"outputs": [],
Expand All @@ -206,7 +214,7 @@
"metadata": {},
"source": [
"# # Delete a custom embedding\n",
"# !advtool embeddings delete cj7j0ukre0771000blj4qnxgn"
"# !advtool embeddings delete ciqtgd94607290000ljx4dvh2"
],
"cell_type": "code",
"outputs": [],
Expand All @@ -222,8 +230,8 @@
{
"metadata": {},
"source": [
"# Upload the payload to Labelbox \n",
"!advtool embeddings import cj7j0ukre0771000blj4qnxgn ./payload.ndjson"
"# Replace the current id with the newly generated id from the previous step, or any existing custom embedding id.\n",
"!advtool embeddings import c933bviqn0756000elk07et77 ./payload.ndjson"
],
"cell_type": "code",
"outputs": [],
Expand All @@ -240,7 +248,7 @@
"metadata": {},
"source": [
"# count how many data rows have a specific custom embedding (This can take a couple of minutes)\n",
"!advtool embeddings count cj7j0ukre0771000blj4qnxgn"
"!advtool embeddings count c933bviqn0756000elk07et77"
],
"cell_type": "code",
"outputs": [],
Expand Down
Loading