Skip to content

Commit d6ef8fa

Browse files
committed
revert optional output for str2bbox
1 parent 04bd784 commit d6ef8fa

File tree

1 file changed

+7
-4
lines changed
  • stac_fastapi/types/stac_fastapi/types

1 file changed

+7
-4
lines changed

stac_fastapi/types/stac_fastapi/types/search.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@ def str2list(x: str) -> Optional[List[str]]:
3131
return None
3232

3333

34-
def str2bbox(x: str) -> BBox:
34+
def str2bbox(x: str) -> Optional[BBox]:
3535
"""Convert string to BBox based on , delimiter."""
36-
t = tuple(float(v) for v in x.split(","))
37-
assert len(t) in [4, 6], f"BBox '{x}' must have 4 or 6 values."
38-
return t
36+
if x:
37+
t = tuple(float(v) for v in x.split(","))
38+
assert len(t) in [4, 6], f"BBox '{x}' must have 4 or 6 values."
39+
return t
40+
41+
return None
3942

4043

4144
def _collection_converter(

0 commit comments

Comments
 (0)