Decorators ========== Reusable decorators that add cross-cutting behaviour (caching, retries, …) to any callable. Unlike the Lambda-specific decorators under :doc:`/services/lambdas/decorators`, these are framework-agnostic and work with plain functions, ETL methods, or any other callable. .. note:: **Serialization format (pickle)** Cached values are serialized with Python's :mod:`pickle` module. Bandit flags ``pickle`` by default (rules B403 and B301) because deserializing data from an *untrusted* source can execute arbitrary code. That risk does not apply here: the only data ever passed to ``pickle.loads()`` is data that *this library* previously wrote with ``pickle.dumps()``. There is no user-controlled input anywhere in the deserialization path, so the Bandit warnings are suppressed with ``# nosec B403`` / ``# nosec B301``. **Do not point these decorators at S3 objects or DynamoDB items that are writable by untrusted parties.** .. toctree:: :maxdepth: 1 cache_dynamo_based cache_s3_based