Skip to content

Commit 500ec9a

Browse files
rllinrllin
authored andcommitted
fix types
1 parent 72c2d06 commit 500ec9a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

labelbox/schema/project.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)