Skip to content

Commit 74babbe

Browse files
Merge pull request #705 from Labelbox/kkim/AL-3545
[AL-3545] Remove get_data_rows_for_global_keys on initial release
2 parents 3df7735 + ee6ca83 commit 74babbe

File tree

2 files changed

+4
-42
lines changed

2 files changed

+4
-42
lines changed

labelbox/client.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,45 +1192,3 @@ def _format_failed_rows(rows: List[str],
11921192
"Timed out waiting for get_data_rows_for_global_keys job to complete."
11931193
)
11941194
time.sleep(sleep_time)
1195-
1196-
def get_data_rows_for_global_keys(
1197-
self,
1198-
global_keys: List[str],
1199-
timeout_seconds=60) -> Dict[str, Union[str, List[Any]]]:
1200-
"""
1201-
Gets data rows for a list of global keys.
1202-
1203-
Args:
1204-
A list of global keys
1205-
Returns:
1206-
Dictionary containing 'status', 'results' and 'errors'.
1207-
1208-
'Status' contains the outcome of this job. It can be one of
1209-
'Success', 'Partial Success', or 'Failure'.
1210-
1211-
'Results' contains a list of `DataRow` instances successfully fetchced. It may
1212-
not necessarily contain all data rows requested.
1213-
1214-
'Errors' contains a list of global_keys that could not be fetched, along
1215-
with the failure reason
1216-
Examples:
1217-
>>> job_result = client.get_data_rows_for_global_keys(["key1","key2"])
1218-
>>> print(job_result['status'])
1219-
Partial Success
1220-
>>> print(job_result['results'])
1221-
[<DataRow ID: cl7tvvybc00icka6ggipyh8tj>, <DataRow ID: cl7tvvyfp00igka6gblrw2idc>]
1222-
>>> print(job_result['errors'])
1223-
[{'global_key': 'asdf', 'error': 'Data Row not found'}]
1224-
"""
1225-
job_result = self.get_data_row_ids_for_global_keys(
1226-
global_keys, timeout_seconds)
1227-
1228-
# Query for data row by data_row_id to ensure we get all fields populated in DataRow instances
1229-
data_rows = []
1230-
for data_row_id in job_result['results']:
1231-
# TODO: Need to optimize this to run over a collection of data_row_ids
1232-
data_rows.append(self.get_data_row(data_row_id))
1233-
1234-
job_result['results'] = data_rows
1235-
1236-
return job_result

tests/integration/test_global_keys.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ def test_global_key_with_whitespaces_validation(client, dataset, image_url):
147147
['Invalid global key', 'Invalid global key', 'Invalid global key'])
148148

149149

150+
@pytest.mark.skip(reason='get_data_rows_for_global_keys not included in '
151+
'the initial release of global_keys')
150152
def test_get_data_rows_for_global_keys(client, dataset, image_url):
151153
gk_1 = str(uuid.uuid4())
152154
gk_2 = str(uuid.uuid4())
@@ -174,6 +176,8 @@ def test_get_data_rows_for_global_keys(client, dataset, image_url):
174176
assert res['results'] == [dr_1, dr_2]
175177

176178

179+
@pytest.mark.skip(reason='get_data_rows_for_global_keys not included in '
180+
'the initial release of global_keys')
177181
def test_get_data_rows_for_invalid_global_keys(client, dataset, image_url):
178182
gk_1 = str(uuid.uuid4())
179183
gk_2 = str(uuid.uuid4())

0 commit comments

Comments
 (0)