Skip to content

Commit

Permalink
Merge 6f6bf4a into 284065d
Browse files Browse the repository at this point in the history
  • Loading branch information
jpinner-lyft committed Jun 10, 2019
2 parents 284065d + 6f6bf4a commit ade4681
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 19 deletions.
1 change: 1 addition & 0 deletions docs/release_notes.rst
Expand Up @@ -48,6 +48,7 @@ Other changes in this release:
* Added the ``max_pool_connection`` and ``extra_headers`` settings to replace common use cases for ``session_cls``
* Added support for `moto <https://github.com/spulec/moto>`_ through implementing the botocore "before-send" hook. Other botocore hooks remain unimplemented.
* Performance improvements to ``UTCDateTimeAttribute`` deserialization. (#610)
* The ``MapAttributeMeta`` class has been removed. Now ``type(MapAttribute) == AttributeContainerMeta``.


v3.3.3
Expand Down
7 changes: 0 additions & 7 deletions pynamodb/attributes.py
Expand Up @@ -565,13 +565,6 @@ def deserialize(self, value):
return None


class MapAttributeMeta(AttributeContainerMeta):
"""
This is only here for backwards compatibility: i.e. so type(MapAttribute) == MapAttributeMeta
"""


@add_metaclass(MapAttributeMeta)
class MapAttribute(Attribute, AttributeContainer):
"""
A Map Attribute
Expand Down
4 changes: 2 additions & 2 deletions pynamodb/attributes.pyi
Expand Up @@ -137,10 +137,10 @@ class NullAttribute(Attribute[None]):
@overload
def __get__(self, instance: Any, owner: Any) -> None: ...

class MapAttributeMeta(type):
class AttributeContainerMeta(type):
def __init__(cls, name, bases, attrs) -> None: ...

class MapAttribute(Generic[_KT, _VT], Attribute[Mapping[_KT, _VT]], metaclass=MapAttributeMeta):
class MapAttribute(Generic[_KT, _VT], Attribute[Mapping[_KT, _VT]]):
attribute_values: Any
def __init__(self, hash_key: bool = ..., range_key: bool = ..., null: Optional[bool] = ..., default: Optional[Union[Any, Callable[..., Any]]] = ..., attr_name: Optional[Text] = ..., **attrs) -> None: ...
def __iter__(self) -> Iterable[_VT]: ...
Expand Down
4 changes: 0 additions & 4 deletions pynamodb/constants.pyi
Expand Up @@ -145,11 +145,7 @@ ALL_PROJECTED_ATTRIBUTES: str
SPECIFIC_ATTRIBUTES: str
COUNT: str
SELECT_VALUES: List[str]
PAY_PER_REQUEST_BILLING_MODE: str
PROVISIONED_BILLING_MODE: str
AVAILABLE_BILLING_MODES: List[str]
DEFAULT_BILLING_MODE: str
BILLING_MODE: str
AND: str
OR: str
BETWEEN: str
Expand Down
7 changes: 1 addition & 6 deletions pynamodb/tests/test_attributes.py
Expand Up @@ -7,7 +7,6 @@
from base64 import b64encode
from datetime import datetime

from dateutil.parser import parse
from dateutil.tz import tzutc

from mock import patch, Mock, call
Expand All @@ -16,8 +15,7 @@
from pynamodb.attributes import (
BinarySetAttribute, BinaryAttribute, NumberSetAttribute, NumberAttribute,
UnicodeAttribute, UnicodeSetAttribute, UTCDateTimeAttribute, BooleanAttribute, LegacyBooleanAttribute,
MapAttribute, MapAttributeMeta, ListAttribute, JSONAttribute, _get_value_for_deserialize,
_fast_parse_utc_datestring,
MapAttribute, ListAttribute, JSONAttribute, _get_value_for_deserialize, _fast_parse_utc_datestring,
)
from pynamodb.constants import (
DATETIME_FORMAT, DEFAULT_ENCODING, NUMBER, STRING, STRING_SET, NUMBER_SET, BINARY_SET,
Expand Down Expand Up @@ -828,9 +826,6 @@ class ThingModel(Model):
with pytest.raises(KeyError):
bad = t.nested['something_else']

def test_metaclass(self):
assert type(MapAttribute) == MapAttributeMeta

def test_attribute_paths_subclassing(self):
class SubMapAttribute(MapAttribute):
foo = UnicodeAttribute(attr_name='dyn_foo')
Expand Down

0 comments on commit ade4681

Please sign in to comment.