Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release_notes: document more breaking changes #1222

Merged
merged 9 commits into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,23 @@ Breaking changes:
for a safe JSON-serializable representation.

* Python 3.6 is no longer supported.
* :meth:`Index.count <pynamodb.indexes.Index.count>`, :meth:`Index.query <pynamodb.indexes.Index.query>`,
and :meth:`Indexn.scan <pynamodb.indexes.Index.scan>` are now instance methods.
* :py:class:`~pynamodb.settings.OperationSettings` has been removed
* PynamoDB no longer has a default AWS region (used to be us-east-1) (:pr:`1003`).
If needed, update your models' `Meta` or set the `AWS_DEFAULT_REGION` environment variable.
* :py:class:`~pynamodb.models.Model`'s JSON serialization helpers were changed:

* :code:`to_json` was renamed to :meth:`~pynamodb.attributes.AttributeContainer.to_simple_dict` (:pr:`1126`). Additionally, :meth:`~pynamodb.attributes.AttributeContainer.to_dynamodb_dict`
and :meth:`~pynamodb.attributes.AttributeContainer.from_dynamodb_dict` were added for round-trip JSON serialization.
* :code:`pynamodb.util.attribute_value_to_json` was removed (:pr:`1126`)

* :py:class:`~pynamodb.attributes.Attribute`'s :code:`default` parameter must be either an immutable value
(of one of the built-in immutable types) or a callable.
This prevents a common class of errors caused by unintentionally mutating the default value.
A simple workaround is to pass an initializer (e.g. change :code:`default={}` to
:code:`default=dict`) or wrap in a lambda (e.g. change :code:`default={'foo': 'bar'}` to
:code:`default=lambda: {'foo': 'bar'}`).
* :meth:`~pynamodb.indexes.Index.count`, :meth:`~pynamodb.indexes.Index.query`,
and :meth:`~pynamodb.indexes.Index.scan` are now instance methods.
* :py:class:`~pynamodb.settings.OperationSettings` has been removed.

Major changes:

Expand Down
Loading