File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 2828from vws .include_target_data import CloudRecoIncludeTargetData
2929from vws .reports import QueryResult , TargetData
3030
31+ _ImageType = io .BytesIO | io .BufferedRandom
3132
32- def _get_image_data (image : io .BytesIO | io .BufferedRandom ) -> bytes :
33+
34+ def _get_image_data (image : _ImageType ) -> bytes :
3335 """Get the data of an image file."""
3436 original_tell = image .tell ()
3537 image .seek (0 )
@@ -61,7 +63,7 @@ def __init__(
6163
6264 def query (
6365 self ,
64- image : io . BytesIO | io . BufferedRandom ,
66+ image : _ImageType ,
6567 max_num_results : int = 1 ,
6668 include_target_data : CloudRecoIncludeTargetData = (
6769 CloudRecoIncludeTargetData .TOP
Original file line number Diff line number Diff line change 88import time
99from datetime import date
1010from http import HTTPMethod , HTTPStatus
11- from io import BufferedRandom
1211from urllib .parse import urljoin
1312
1413import requests
4847
4948from .exceptions .response import Response
5049
50+ _ImageType = io .BytesIO | io .BufferedRandom
5151
52- def _get_image_data (image : io .BytesIO | BufferedRandom ) -> bytes :
52+
53+ def _get_image_data (image : _ImageType ) -> bytes :
5354 """Get the data of an image file."""
5455 original_tell = image .tell ()
5556 image .seek (0 )
@@ -234,7 +235,7 @@ def add_target(
234235 self ,
235236 name : str ,
236237 width : float ,
237- image : io . BytesIO | io . BufferedRandom ,
238+ image : _ImageType ,
238239 application_metadata : str | None ,
239240 * ,
240241 active_flag : bool ,
@@ -617,7 +618,7 @@ def update_target(
617618 target_id : str ,
618619 name : str | None = None ,
619620 width : float | None = None ,
620- image : io . BytesIO | io . BufferedRandom | None = None ,
621+ image : _ImageType | None = None ,
621622 active_flag : bool | None = None ,
622623 application_metadata : str | None = None ,
623624 ) -> None :
You can’t perform that action at this time.
0 commit comments