From 33c66a29df68dada7a7f1d4fe0e9b60bf3b9bc8a Mon Sep 17 00:00:00 2001 From: Derek Knapp Date: Fri, 9 Feb 2024 21:59:15 -0800 Subject: [PATCH] cast --- pynamodb/connection/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pynamodb/connection/base.py b/pynamodb/connection/base.py index 00d4d5c6..939d5c08 100644 --- a/pynamodb/connection/base.py +++ b/pynamodb/connection/base.py @@ -357,7 +357,7 @@ def _make_api_call(self, operation_name: str, operation_kwargs: Dict) -> Dict: CancellationReason( code=d['Code'], message=d.get('Message'), - item=d.get('Item'), + item=cast(Optional[Dict[str, Dict[str, Any]]], d.get('Item')), ) if d['Code'] != 'None' else None ) for d in cancellation_reasons