Skip to content

Commit 84469c4

Browse files
authored
release_notes: document more breaking changes (#1222)
1 parent 06c3a32 commit 84469c4

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

docs/release_notes.rst

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,23 @@ Breaking changes:
2020
for a safe JSON-serializable representation.
2121

2222
* Python 3.6 is no longer supported.
23-
* :meth:`Index.count <pynamodb.indexes.Index.count>`, :meth:`Index.query <pynamodb.indexes.Index.query>`,
24-
and :meth:`Indexn.scan <pynamodb.indexes.Index.scan>` are now instance methods.
25-
* :py:class:`~pynamodb.settings.OperationSettings` has been removed
23+
* PynamoDB no longer has a default AWS region (used to be us-east-1) (:pr:`1003`).
24+
If needed, update your models' `Meta` or set the `AWS_DEFAULT_REGION` environment variable.
25+
* :py:class:`~pynamodb.models.Model`'s JSON serialization helpers were changed:
26+
27+
* :code:`to_json` was renamed to :meth:`~pynamodb.attributes.AttributeContainer.to_simple_dict` (:pr:`1126`). Additionally, :meth:`~pynamodb.attributes.AttributeContainer.to_dynamodb_dict`
28+
and :meth:`~pynamodb.attributes.AttributeContainer.from_dynamodb_dict` were added for round-trip JSON serialization.
29+
* :code:`pynamodb.util.attribute_value_to_json` was removed (:pr:`1126`)
30+
31+
* :py:class:`~pynamodb.attributes.Attribute`'s :code:`default` parameter must be either an immutable value
32+
(of one of the built-in immutable types) or a callable.
33+
This prevents a common class of errors caused by unintentionally mutating the default value.
34+
A simple workaround is to pass an initializer (e.g. change :code:`default={}` to
35+
:code:`default=dict`) or wrap in a lambda (e.g. change :code:`default={'foo': 'bar'}` to
36+
:code:`default=lambda: {'foo': 'bar'}`).
37+
* :meth:`~pynamodb.indexes.Index.count`, :meth:`~pynamodb.indexes.Index.query`,
38+
and :meth:`~pynamodb.indexes.Index.scan` are now instance methods.
39+
* :py:class:`~pynamodb.settings.OperationSettings` has been removed.
2640

2741
Major changes:
2842

0 commit comments

Comments
 (0)