Dynamorm

Latest version: v0.10.0

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

Scan your dependencies

Page 1 of 3

0.10.0

* Enable support for updating nested paths in ``Table.update``. Like functions (like ``minus`` or ``if_not_exists``) nested paths are also separated using the double-underscore syntax. For example, given an attribute ``foo`` of an item ``i``:::

"foo": {
"bar": {
"a": 1
},
"baz": 10
}

i.update(foo__bar__a=42)
"foo": {
"bar": {
"a": 42
},
"baz": 10
}

i.update(foo__baz__plus=32)
"foo": {
"bar": {
"a": 42
},
"baz": 42
}

This works because DynamoDB allows updating of nested attributes, using something like JSON path. From the `DynamoDB Developer Guide`_::

aws dynamodb update-item \
--table-name ProductCatalog \
--key '{"Id":{"N":"789"}}' \
--update-expression "SET pr.5star[1] = :r5, pr.3star = :r3" \
--expression-attribute-names '{
"pr": "ProductReviews",
"5star": "FiveStar",
"3star": "ThreeStar"
}' \
--expression-attribute-values '{
":r5": { "S": "Very happy with my purchase" },
":r3": {
"L": [
{ "S": "Just OK - not that great" }
]
}
}' \
--return-values ALL_NEW

Note that the attribute names along the nested path are broken up - this helps distinguish a nested update from a flat key like ``my.flat.key`` that contains a period.

.. _`DynamoDB Developer Guide`: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.htmlExpressions.UpdateExpressions.SET.AddingNestedMapAttributes

0.9.15

* Address ``DeprecationWarning`` for ``collections.abc`` in Python 3.3+

0.9.14

* Ensure that ``dynamorm_validate`` actually calls ``schematics`` validation.

0.9.13

* Check that recursive mode is enabled before warning about trying to use both limit and recursive.

0.9.12

* Ensure GitHub pages serves our static documentation content
* No functional library changes

0.9.11

* Bug fix: Don't mutate dictionaries passed to table methods.

This caused problems with ``ReadIterator`` objects that called ``.again()`` because the underlying Table object would end up mutating state on the iterator object.

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.