Change log - Migration guide.

DynamoDBMapper 1.7.0

This section documents all user visible changes included between DynamoDBMapper versions 1.6.2 and versions 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 for initialization should be replaced by __init__(**kwargs)
  • 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

DynamoDBMapper 1.6.3

This section documents all user visible changes included between DynamoDBMapper versions 1.6.2 and versions 1.6.3

Changes

  • fix bug #11 in delete. Keys where not serialized.

DynamoDBMapper 1.6.2

This section documents all user visible changes included between DynamoDBMapper versions 1.6.1 and versions 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__()

DynamoDBMapper 1.6.1

This section documents all user visible changes included between DynamoDBMapper version 1.6.0 and version 1.6.1

Changes

  • fixed bug in scan

DynamoDBMapper 1.6.0

This section documents all user visible changes included between DynamoDBMapper versions 1.5.0 and versions 1.6.0

Additions

  • support for default values in a __defaults__ dict
  • specify instances members via global __init__ **kwargs
  • autogenerated API documentation

Changes

  • transactions engine rewrite to support multiple targets
  • transactions always persisted after first write attempt
  • transactions engine now embeds its own minimal schema
  • transactions can be set transient on a ‘per instance basis’ instead of class
  • autoinc hash key now relies on atomic add to prevent risks of races
  • autoinc magic element moved to -1 instead of 0 to prevent accidental overwrite
  • autoinc magic element now hidden from scan results
  • factorized default value code
  • enforce batch size 100 limit
  • full inline documentation
  • fixed issue: All transactions fail if they have a bool field set to False
  • 99% test coverage

Removal

(None)

Upgrade

autoinc
For all tables relying on autoinc feature, manually move element at 'hash_key' = 0 to 'hash_key' = -1.
transactions
Should be retro-compatible but you are strongly advised to adopt the new API. - specify targets and setters via Transactions._get_transactors - avoid any use of Transactions._get_target and Transactions._alter_target - save is now called automatically as long as at least 1 write was attempted - __schema__ might not be required anymore due to Transaction having a new one - requester_id hash key must be set by the user See these method’s documentation for more informations

Known bugs

(None)