From 7d18cfe1c6b95ae6690d5092ebfb14331d993999 Mon Sep 17 00:00:00 2001 From: Seth Fitzsimmons Date: Mon, 9 Mar 2026 23:43:32 -0700 Subject: [PATCH] Fix missing return in BBox dict validator The dict branch of the Pydantic validator in BBox.__get_pydantic_core_schema__ constructed a BBox from the dict but didn't return it, silently producing None. Add the missing return statement. The test parametrize case for dict input covers this path. --- .../src/overture/schema/system/primitive/bbox.py | 2 +- packages/overture-schema-system/tests/primitive/test_bbox.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/overture-schema-system/src/overture/schema/system/primitive/bbox.py b/packages/overture-schema-system/src/overture/schema/system/primitive/bbox.py index ac0eef391..c078290c5 100644 --- a/packages/overture-schema-system/src/overture/schema/system/primitive/bbox.py +++ b/packages/overture-schema-system/src/overture/schema/system/primitive/bbox.py @@ -237,7 +237,7 @@ def validator( elif isinstance(value, tuple | list): return cls.from_geo_json(value) elif isinstance(value, dict): - BBox(**value) + return BBox(**value) else: raise TypeError( f"expected `BBox` or `tuple` or `list`; got `{type(value).__name__}` with value {repr(value)}" diff --git a/packages/overture-schema-system/tests/primitive/test_bbox.py b/packages/overture-schema-system/tests/primitive/test_bbox.py index 530793bf5..31146720a 100644 --- a/packages/overture-schema-system/tests/primitive/test_bbox.py +++ b/packages/overture-schema-system/tests/primitive/test_bbox.py @@ -195,6 +195,7 @@ class TestModel(BaseModel): [ ((1, 2, 3, 4), BBox(xmin=1, ymin=2, xmax=3, ymax=4)), (BBox(0, -1, -2, 3), BBox(0, -1, -2, 3)), + ({"xmin": -1, "ymin": -2, "xmax": 1, "ymax": 2}, BBox(-1, -2, 1, 2)), ], ) def test_pydantic_validation_success(input: Any, expect: BBox) -> None: