File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -376,7 +376,7 @@ def upload_annotations(
376376 """
377377 if isinstance (annotations , str ) or isinstance (annotations , Path ):
378378
379- def _is_url_valid (url : str ) -> bool :
379+ def _is_url_valid (url : Union [ str , Path ] ) -> bool :
380380 """ Verifies that the given string is a valid url.
381381
382382 Args:
@@ -385,6 +385,8 @@ def _is_url_valid(url: str) -> bool:
385385 True if the given url is valid otherwise False
386386
387387 """
388+ if isinstance (url , Path ):
389+ return False
388390 parsed = urlparse (url )
389391 return bool (parsed .scheme ) and bool (parsed .netloc )
390392
@@ -393,7 +395,7 @@ def _is_url_valid(url: str) -> bool:
393395 client = self .client ,
394396 project_id = self .uid ,
395397 name = name ,
396- url = annotations ,
398+ url = str ( annotations ) ,
397399 )
398400 else :
399401 path = Path (annotations )
You can’t perform that action at this time.
0 commit comments