Skip to content

Bug: CachePersistenceLayer raises the deprecation warning that tells you to use CachePersistenceLayer #8574

Closed

Description

@leandrodamascena

Expected Behaviour

Using CachePersistenceLayer, CacheConnection or CacheClientProtocol should not raise any deprecation warning. Only the old Redis* names should.

Current Behaviour

CachePersistenceLayer(client=...) raises RedisCachePersistenceLayer will be removed in v4.0.0. Please use CachePersistenceLayer instead. The new names are TypeAlias to the deprecated classes, so they are the same object and @deprecated fires for both.

Code snippet

import warnings
from aws_lambda_powertools.utilities.idempotency.persistence.cache import CachePersistenceLayer

warnings.simplefilter("always")
CachePersistenceLayer(client=my_redis_client)
# DeprecationWarning: RedisCachePersistenceLayer will be removed in v4.0.0. Please use CachePersistenceLayer instead.

Possible Solution

Move the implementation to cache.py under the new names and keep redis.py as thin @deprecated subclasses.

Steps to Reproduce

Run the snippet above with any Redis client.

Powertools for AWS Lambda (Python) version

latest

AWS Lambda function runtime

3.13

Packaging format used

PyPi

Debugging logs

Warning

This issue is ready to be picked up, by humans or by agents. If you want it, comment here first so we can assign it to you, and please take only one or two issues at a time so others can join in too. Thanks!

Activity

  1. added this to the 3.38.0 milestone on Oct 18, 2026
  2. MrNK2107 commented on Oct 18, 2026

    @MrNK2107
    Contributor

    Hi @leandrodamascena, I'd like to take this one too (I'll keep it to these two). Plan: move the implementation into cache.py under the CachePersistenceLayer / CacheConnection / CacheClientProtocol names, and keep redis.py as thin @deprecated subclasses/aliases so only the old Redis* names warn. Tests will check that the new names emit no DeprecationWarning, the old names still do, and isinstance keeps working both ways.

    Could you assign it to me?

  3. leandrodamascena commented on Oct 18, 2026

    @leandrodamascena
    ContributorAuthor

    Hey @MrNK2107 pls go ahead.

  4. added a commit that references this issue on Oct 18, 2026
    acbea71
  5. powertools-for-aws-oss-automation commented on Oct 22, 2026

    @powertools-for-aws-oss-automation

    Warning

    This issue is now closed. Please be mindful that future comments are hard for our team to see.
    If you need more assistance, please either reopen the issue, or open a new issue referencing this one.
    If you wish to keep having a conversation with other community members under this issue feel free to do so.

  6. added
    pending-releaseFix or implementation already in dev waiting to be released
    and removed
    triagePending triage from maintainers
    on Oct 22, 2026
  7. added a commit that references this issue on Oct 22, 2026
    2af58c0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomerspending-releaseFix or implementation already in dev waiting to be released

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions