From dc46a435dac9881286258ec91ac66029f0d33111 Mon Sep 17 00:00:00 2001 From: Jonathan Schoonhoven Date: Fri, 22 Sep 2017 06:57:51 -0700 Subject: [PATCH] allow all valid JSON in pynamodb JSONAttribute (#1604) Currently, the type definition for `JSONAttribute` assumes the deserialized value will be a `dict`. However, a `list` is also a valid `JSONAttribute` (its [deserialize](https://github.com/pynamodb/PynamoDB/blob/495eae28679c781afc27f7d2d8c417e2302ed2a1/pynamodb/attributes.py#L418) method just calls `json.loads`. --- third_party/2and3/pynamodb/attributes.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/2and3/pynamodb/attributes.pyi b/third_party/2and3/pynamodb/attributes.pyi index 1b2c2d8c3..d450d0e5d 100644 --- a/third_party/2and3/pynamodb/attributes.pyi +++ b/third_party/2and3/pynamodb/attributes.pyi @@ -39,8 +39,8 @@ class UnicodeSetAttribute(SetMixin, Attribute[Set[Text]]): class UnicodeAttribute(Attribute[Text]): def __get__(self, instance: Any, owner: Any) -> Text: ... -class JSONAttribute(Attribute[Dict[Text, Any]]): - def __get__(self, instance: Any, owner: Any) -> Dict[Text, Any]: ... +class JSONAttribute(Attribute[Any]): + def __get__(self, instance: Any, owner: Any) -> Any: ... class LegacyBooleanAttribute(Attribute[bool]): def __get__(self, instance: Any, owner: Any) -> bool: ...