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(
376
376
"""
377
377
if isinstance (annotations , str ) or isinstance (annotations , Path ):
378
378
379
- def _is_url_valid (url : str ) -> bool :
379
+ def _is_url_valid (url : Union [ str , Path ] ) -> bool :
380
380
""" Verifies that the given string is a valid url.
381
381
382
382
Args:
@@ -385,6 +385,8 @@ def _is_url_valid(url: str) -> bool:
385
385
True if the given url is valid otherwise False
386
386
387
387
"""
388
+ if isinstance (url , Path ):
389
+ return False
388
390
parsed = urlparse (url )
389
391
return bool (parsed .scheme ) and bool (parsed .netloc )
390
392
@@ -393,7 +395,7 @@ def _is_url_valid(url: str) -> bool:
393
395
client = self .client ,
394
396
project_id = self .uid ,
395
397
name = name ,
396
- url = annotations ,
398
+ url = str ( annotations ) ,
397
399
)
398
400
else :
399
401
path = Path (annotations )
You can’t perform that action at this time.
0 commit comments