Skip to content

Commit

Permalink
Update CHANGES.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamsorcerer authored Feb 27, 2023
1 parent ce2f26a commit 3d50611
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@ Migration instructions

There are a number of backwards-incompatible changes. These points should help with migrating from an older release:

* The ``key_builder`` parameter now expects a callback which accepts 2 strings and returns a string in all cache implementations, making the builders simpler and interchangeable.
* The ``key`` parameter has been removed from the ``cached`` decorator. The behaviour can be easily reimplemented with ``key_builder=lambda *a, **kw: "foo"``
* When using the ``key_builder`` parameter in ``@multicached``, the function will now return the original, unmodified keys, only using the transformed keys in the cache (this has always been the documented behaviour, but not the implemented behaviour).
* ``BaseSerializer`` is now an ``ABC``, so cannot be instantiated directly.
* Each backend cache implementation must specify the data type of its cache key,
``CachKeyType``, when deriving from ``BaseCache[CachKeyType]``. The abstract method,
``build_key()`` must be defined and return a cache key of the corresponding type.
* The logic for encoding a cache key and selecting the key's namespace is now expected to be
encapsulated in the ``build_key(key, namespace)`` member of backend cache implementations
that are derived from ``BaseCache[CachKeyType]``. Now instantiating a cache with a custom
``key_builder`` argument simply requires that function to return any string that maps from the
``key`` and ``namespace`` parameters (which are also strings).
* If subclassing ``BaseCache`` to implement a custom backend:
* The cache key type used by the backend must now be specified when inheriting (e.g. ``BaseCache[str]`` typically).
* The ``build_key()`` method must now be defined (this should generally involve calling ``self._str_build_key()`` as a helper).


0.12.0 (2023-01-13)
Expand Down

0 comments on commit 3d50611

Please sign in to comment.