Skip to content

Commit b77143d

Browse files
committed
Update __init__.py
1 parent 9f15095 commit b77143d

14 files changed

+411
-413
lines changed

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
minversion = 3.7
33
log_cli=true
44
python_files = test_*.py
5+
;pytest_plugins = ['pytest_profiling']
56
addopts = -n auto --dist=loadscope

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ requests==2.26.0
44
requests-toolbelt>=0.9.1
55
tqdm==4.48.2
66
pillow>=7.2.0
7-
numpy>=1.19.0
87
matplotlib>=3.3.1
98
xmltodict==0.12.0
109
opencv-python>=4.4.0.42
1110
wheel==0.35.1
1211
packaging>=20.4
13-
pandas>=1.1.4
1412
plotly==4.1.0
1513
ffmpeg-python>=0.2.0
1614
fire==0.4.0
@@ -21,3 +19,4 @@ aiohttp==3.8.1
2119
email-validator>=1.0.3
2220
nest-asyncio==1.5.4
2321
jsonschema==3.2.0
22+
pandas>=1.1.4

src/superannotate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import sys
33

4-
__version__ = "4.4.2dev1"
4+
__version__ = "4.4.2dev2"
55

66
sys.path.append(os.path.split(os.path.realpath(__file__))[0])
77

src/superannotate/lib/core/service_types.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,20 @@ class UploadCustomFieldValues(BaseModel):
8888

8989

9090
class ServiceResponse(BaseModel):
91-
status: int
92-
reason: str
93-
content: Union[bytes, str]
94-
data: Any
91+
status: Optional[int]
92+
reason: Optional[str]
93+
content: Optional[Union[bytes, str]]
94+
data: Optional[Any]
9595
count: Optional[int] = 0
96-
_error: str = None
96+
_error: Optional[str] = None
9797

9898
class Config:
9999
extra = Extra.allow
100100

101-
def __init__(self, response, content_type=None, dispatcher: Callable = None):
101+
def __init__(self, response=None, content_type=None, dispatcher: Callable = None):
102+
if not response:
103+
super().__init__()
104+
return
102105
data = {
103106
"status": response.status_code,
104107
"reason": response.reason,
@@ -133,7 +136,9 @@ def status_code(self):
133136

134137
@property
135138
def ok(self):
136-
return 199 < self.status < 300
139+
if self.status:
140+
return 199 < self.status < 300
141+
return False
137142

138143
@property
139144
def error(self):

src/superannotate/lib/core/serviceproviders.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def saqul_query(
363363
def validate_saqul_query(self, team_id: int, project_id: int, query: str) -> dict:
364364
raise NotImplementedError
365365

366-
def upload_annotations(
366+
async def upload_annotations(
367367
self,
368368
team_id: int,
369369
project_id: int,
@@ -372,7 +372,7 @@ def upload_annotations(
372372
) -> ServiceResponse:
373373
raise NotImplementedError
374374

375-
def upload_big_annotation(
375+
async def upload_big_annotation(
376376
self,
377377
team_id: int,
378378
project_id: int,

0 commit comments

Comments
 (0)