Skip to content

Commit 2127ca1

Browse files
chore: ruff formatting.
1 parent 762ce6a commit 2127ca1

6 files changed

Lines changed: 9 additions & 28 deletions

File tree

‎jigsawstack/async_request.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,7 @@ async def make_request(
256256
_form_data = aiohttp.FormData()
257257
_form_data.add_field("file", BytesIO(files["file"]), filename="upload")
258258
if params and isinstance(params, dict):
259-
_form_data.add_field(
260-
"body", json.dumps(params), content_type="application/json"
261-
)
259+
_form_data.add_field("body", json.dumps(params), content_type="application/json")
262260

263261
headers.pop("Content-Type", None)
264262
else: # pure JSON request

‎jigsawstack/embedding.py‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ def __init__(
4646
@overload
4747
def execute(self, params: EmbeddingParams) -> EmbeddingResponse: ...
4848
@overload
49-
def execute(
50-
self, blob: bytes, options: EmbeddingParams = None
51-
) -> EmbeddingResponse: ...
49+
def execute(self, blob: bytes, options: EmbeddingParams = None) -> EmbeddingResponse: ...
5250

5351
def execute(
5452
self,
@@ -96,9 +94,7 @@ def __init__(
9694
@overload
9795
async def execute(self, params: EmbeddingParams) -> EmbeddingResponse: ...
9896
@overload
99-
async def execute(
100-
self, blob: bytes, options: EmbeddingParams = None
101-
) -> EmbeddingResponse: ...
97+
async def execute(self, blob: bytes, options: EmbeddingParams = None) -> EmbeddingResponse: ...
10298

10399
async def execute(
104100
self,

‎jigsawstack/embedding_v2.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ def __init__(
4444
@overload
4545
def execute(self, params: EmbeddingV2Params) -> EmbeddingV2Response: ...
4646
@overload
47-
def execute(
48-
self, blob: bytes, options: EmbeddingV2Params = None
49-
) -> EmbeddingV2Response: ...
47+
def execute(self, blob: bytes, options: EmbeddingV2Params = None) -> EmbeddingV2Response: ...
5048

5149
def execute(
5250
self,

‎jigsawstack/request.py‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,7 @@ def perform_file(self) -> Union[T, None]:
9393
# handle error in case there is a statusCode attr present
9494
# and status != 200 and response is a json.
9595

96-
if (
97-
"application/json" not in resp.headers["content-type"]
98-
and resp.status_code != 200
99-
):
96+
if "application/json" not in resp.headers["content-type"] and resp.status_code != 200:
10097
raise_for_code_and_type(
10198
code=500,
10299
message="Failed to parse JigsawStack API response. Please try again.",

‎jigsawstack/translate.py‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ def text(self, params: TranslateParams) -> TranslateResponse:
8383
return resp
8484

8585
@overload
86-
def image(
87-
self, params: TranslateImageParams
88-
) -> Union[TranslateImageResponse, bytes]: ...
86+
def image(self, params: TranslateImageParams) -> Union[TranslateImageResponse, bytes]: ...
8987
@overload
9088
def image(
9189
self, blob: bytes, options: TranslateImageParams = None
@@ -146,9 +144,7 @@ async def text(self, params: TranslateParams) -> TranslateResponse:
146144
return resp
147145

148146
@overload
149-
async def image(
150-
self, params: TranslateImageParams
151-
) -> Union[TranslateImageResponse, bytes]: ...
147+
async def image(self, params: TranslateImageParams) -> Union[TranslateImageResponse, bytes]: ...
152148
@overload
153149
async def image(
154150
self, blob: bytes, options: TranslateImageParams = None

‎jigsawstack/vision.py‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,7 @@ def vocr(
215215
return resp
216216

217217
@overload
218-
def object_detection(
219-
self, params: ObjectDetectionParams
220-
) -> ObjectDetectionResponse: ...
218+
def object_detection(self, params: ObjectDetectionParams) -> ObjectDetectionResponse: ...
221219
@overload
222220
def object_detection(
223221
self, blob: bytes, options: ObjectDetectionParams = None
@@ -297,9 +295,7 @@ async def vocr(
297295
return resp
298296

299297
@overload
300-
async def object_detection(
301-
self, params: ObjectDetectionParams
302-
) -> ObjectDetectionResponse: ...
298+
async def object_detection(self, params: ObjectDetectionParams) -> ObjectDetectionResponse: ...
303299
@overload
304300
async def object_detection(
305301
self, blob: bytes, options: ObjectDetectionParams = None

0 commit comments

Comments
 (0)