From e7b567c1f4ed0200d3e21f681d294936589a270d Mon Sep 17 00:00:00 2001 From: Asim Goheer Date: Fri, 16 Feb 2018 16:54:45 -0800 Subject: [PATCH] Issue 1858: pynamodb 3.2.1 added new methods in Attributes which are not in typeshed (#1859) --- third_party/2and3/pynamodb/attributes.pyi | 13 +++++++++++++ third_party/2and3/pynamodb/models.pyi | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/third_party/2and3/pynamodb/attributes.pyi b/third_party/2and3/pynamodb/attributes.pyi index 34ebf878a..f2a2c8e82 100644 --- a/third_party/2and3/pynamodb/attributes.pyi +++ b/third_party/2and3/pynamodb/attributes.pyi @@ -19,6 +19,19 @@ class Attribute(Generic[_T]): def serialize(self, value: Any) -> Any: ... def deserialize(self, value: Any) -> Any: ... def get_value(self, value: Any) -> Any: ... + def between(self, lower: Any, upper: Any) -> Any: ... + def is_in(self, *values: Any) -> Any: ... + def exists(self) -> Any: ... + def does_not_exist(self) -> Any: ... + def is_type(self) -> Any: ... + def startswith(self, prefix: str) -> Any: ... + def contains(self, item: Any) -> Any: ... + def append(self, other: Any) -> Any: ... + def prepend(self, other: Any) -> Any: ... + def set(self, value: Any) -> Any: ... + def remove(self) -> Any: ... + def add(self, *values: Any) -> Any: ... + def delete(self, *values: Any) -> Any: ... class SetMixin(object): def serialize(self, value): ... diff --git a/third_party/2and3/pynamodb/models.pyi b/third_party/2and3/pynamodb/models.pyi index a44f6a144..4bc07e7a0 100644 --- a/third_party/2and3/pynamodb/models.pyi +++ b/third_party/2and3/pynamodb/models.pyi @@ -29,9 +29,9 @@ class Model(metaclass=MetaModel): @classmethod def batch_write(cls: Type[_T], auto_commit: bool = ...) -> BatchWrite[_T]: ... def delete(self, conditional_operator: Optional[Text] = ..., **expected_values) -> Any: ... - def update(self, attributes: Dict[Text, Dict[Text, Any]], conditional_operator: Optional[Text] = ..., **expected_values) -> Any: ... + def update(self, attributes: Optional[Dict[Text, Dict[Text, Any]]], actions: Optional[List[Any]], condition: Optional[Any], conditional_operator: Optional[Text] = ..., **expected_values) -> Any: ... def update_item(self, attribute: Text, value: Optional[Any] = ..., action: Optional[Text] = ..., conditional_operator: Optional[Text] = ..., **expected_values): ... - def save(self, conditional_operator: Optional[Text] = ..., **expected_values) -> Dict[str, Any]: ... + def save(self, condition: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., **expected_values) -> Dict[str, Any]: ... def refresh(self, consistent_read: bool = ...): ... @classmethod def get(cls: Type[_T], hash_key: KeyType, range_key: Optional[KeyType] = ..., consistent_read: bool = ...) -> _T: ...