Skip to content

Commit ce7e1c0

Browse files
author
Matt Sokoloff
committed
Merge branch 'develop' of https://github.com/Labelbox/labelbox-python into ms/validation
2 parents d8c7558 + fc6ff5e commit ce7e1c0

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
* Comparing a Labelbox object (e.g. Project) to None doesn't raise an exception
77
* Adding `order_by` to `Project.labels` doesn't raise an exception
88

9-
## Version 2.4.10 (2021-01-05)
9+
## Version 2.4.11 (2021-03-07)
10+
### Fix
11+
* Increase query timeout
12+
* Retry 502s
13+
14+
## Version 2.4.10 (2021-02-05)
1015
### Added
1116
* SDK version added to request headers
1217

labelbox/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __init__(self,
7474
#TODO: Add exponential backoff so we don'tt overwhelm the api
7575
@retry.Retry(predicate=retry.if_exception_type(
7676
labelbox.exceptions.InternalServerError))
77-
def execute(self, query, params=None, timeout=10.0):
77+
def execute(self, query, params=None, timeout=30.0):
7878
""" Sends a request to the server for the execution of the
7979
given query.
8080

tests/integration/test_client_errors.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import time
44
import pytest
55

6-
from labelbox import Project, Dataset, User, LabelingFrontend
6+
from labelbox import Project, Dataset, User
77
import labelbox.client
88
import labelbox.exceptions
99

@@ -112,24 +112,23 @@ def test_invalid_attribute_error(client, rand_gen):
112112

113113
@pytest.mark.skip("timeouts cause failure before rate limit")
114114
def test_api_limit_error(client):
115-
global limited
116-
limited = False
117115

118116
def get(arg):
119117
try:
120118
return client.get_user()
121119
except labelbox.exceptions.ApiLimitError as e:
122120
return e
123121

122+
#Rate limited at 1500 + buffer
124123
n = 1600
124+
#max of 30 concurrency before the service becomes unavailable
125125
with Pool(30) as pool:
126126
start = time.time()
127127
results = list(pool.imap(get, range(n)), total=n)
128128
elapsed = time.time() - start
129129

130130
assert elapsed < 60, "Didn't finish fast enough"
131131
assert labelbox.exceptions.ApiLimitError in {type(r) for r in results}
132-
del limited
133132

134133
# Sleep at the end of this test to allow other tests to execute.
135-
#time.sleep(60)
134+
time.sleep(60)

0 commit comments

Comments
 (0)