Skip to content

Commit cbf57a2

Browse files
refactor: enhance assert bbox length with descriptive message (#800)
* refactor: enhance assert bbox length with descriptive message * docs: changelog update --------- Co-authored-by: Vincent Sarago <[email protected]>
1 parent 290af5c commit cbf57a2

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CHANGES.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
## [Unreleased]
44

5+
### Added
6+
7+
- added descriptive message to `types.search.str2bbox` length assert
8+
59
### Fixed
610

7-
- Fix collection-search POST request model:
8-
- Fix pydantic model to make sure class variables `_start_date` and `_end_date` not edited (ported from stac-pydantic)
9-
- Fix bbox validation to allow anti-meridian crossing (ported from stac-pydantic)
11+
- fix collection-search POST request model:
12+
- fix pydantic model to make sure class variables `_start_date` and `_end_date` not edited (ported from stac-pydantic)
13+
- fix bbox validation to allow anti-meridian crossing (ported from stac-pydantic)
1014

1115
## [5.0.2] - 2025-01-30
1216

stac_fastapi/types/stac_fastapi/types/search.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def str2bbox(x: str) -> Optional[BBox]:
3535
"""Convert string to BBox based on , delimiter."""
3636
if x:
3737
t = tuple(float(v) for v in str2list(x))
38-
assert len(t) == 4
38+
assert len(t) == 4, f"BBox '{x}' must have 4 values."
3939
return t
4040

4141
return None

0 commit comments

Comments
 (0)