Dynamodb-mapper

Latest version: v1.8.1

Safety actively analyzes 681775 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

1.8.0.dev

========================

This section documents all user visible changes included between DynamoDBMapper

1.7.1

====================

This section documents all user visible changes included between DynamoDBMapper

1.7.0

Additions
---------

- migration engine - single object
- method ``ConnectionBorg.set_region`` to specify Amazon's region (thanks kimscheibel)
- method ``DynamoDBModel.from_db_dict`` which additionaly saves ``_raw_data``
- ``raise_on_conflict`` on ``DynamoDBModel.save``, defaults to ``False``
- ``raise_on_conflict`` on ``DynamoDBModel.delete``, defaults to ``False``

Changes
-------

- rename ``ExpectedValueError`` to ``ConflictError`` to reflect its true meaning
- rename ``to_db_dict`` to ``_to_db_dict``. Should not be used anymore
- rename ``from_dict`` to ``_from_db_dict``. Should not be used anymore
- transactions may create new Items (side effect of ``raise_on_conflict`` refactor)
- fix bug 13 in dates de-serialization. (thanks Merwok)
- open only one shared boto connection per process instead of on/thread. Boto is thread-safe
- re-implement ``get_batch`` to rely on boto new generator. Fixes 100 Items limitation and paging.
- boto min version is 2.6.0

Removal
-------

- ``expected_values`` feature was incompatible with the migration engine
- ``allow_overwrite`` feature was not needed with ``raise_on_conflict``
- ``to_db_dict`` and ``from_dict`` are no longer public
- ``ThroughputError``. Throughput checks are delegated to Amazon's API (thanks kimscheibel)
- ``new_batch_list_nominal`` is not needed anymore with boto>=2.6.0

Upgrade
-------

conflict detection
Wherever ``save`` was called with ``expected_values=...`` and/or
``allow_overwrite=False``, replace it with a call to save with
``raise_on_conflict=True``. It should handle most if not all use cases. In
some place, you'll even be able to get rid of ``to_db_dict``. Rename also
all instances of ``ExpectedValueError`` to ``ConflictError``

``raise_on_conflict=True`` --> ``allow_overwrite=False`` for new objects
``raise_on_conflict=True`` --> ``expected_values=...`` for existing objects

data (de-)serialization
``from_dict`` and ``to_db_dict`` have been moved to private ``_from_db_dict``
and ``_to_db_dict``. Any direct use of these should be avoided
``_from_db_dict`` *will* mark data as coming from the DB

- ``from_dict(data_dict)`` for initialization should be replaced by ``__init__(**data_dict)``
- ``to_db_dict`` for data export should be replaced by ``to_json_dict``
- overloading for custom DB Item (de-)serialization can still be done provided that the function is renamed


====================

1.6.3

Changes
-------

- fix bug 11 in delete. Keys were not serialized


====================

1.6.2

Additions
---------

- transactions may generate a list of sub-transactions to run after the main one
- log all successful queries
- add parameter ``limit`` on ``query`` method defaulting to ``None``
- extensive documentation

Upgrade
-------

sub-transactions
If ``__init__()`` is called in any of your transactions, make sure to call
``super(MyTransactionClass, self).__init__(**kwargs)``


Known bugs - limitations
------------------------

- 7 Can't save models where a datetime field is nested in a dict/list
- Can't use ``datetime`` objects in ``scan`` and ``query`` filters
- DynamoDBModel.from_dict() does not check types as opposed to ``__init__()``

====================

1.6.1

====================


This section documents all user visible changes included between DynamoDBMapper

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.