From 7c27e6f2a7475898c28fc71f1ba83f892fe24c4a Mon Sep 17 00:00:00 2001 From: Tom Vo Date: Thu, 5 Sep 2024 11:29:33 -0700 Subject: [PATCH] Fix `TypeError` for optional `region` arg in `TypedDict` --- xcdat/spatial.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xcdat/spatial.py b/xcdat/spatial.py index aec0b9a9..a16fd57a 100644 --- a/xcdat/spatial.py +++ b/xcdat/spatial.py @@ -8,6 +8,7 @@ Hashable, List, Literal, + Optional, Tuple, TypedDict, Union, @@ -263,7 +264,7 @@ def get_weights( and pressure). """ Bounds = TypedDict( - "Bounds", {"weights_method": Callable, "region": np.ndarray | None} + "Bounds", {"weights_method": Callable, "region": Optional[np.ndarray]} ) axis_bounds: Dict[SpatialAxis, Bounds] = {