Skip to content

Conversation

sakosha
Copy link

@sakosha sakosha commented Jun 17, 2025

What do these changes do?

  • Merge MemoryBackend w/ MemoryCache.
  • Merge MemcachedBackend w/ MemcachedCache.
  • Merge ValkeyBackend w/ ValkeyCache.
  • Update tests to use ...Cache.
  • Add type annotations for these classes.
  • Add note to migrating docs.

Are there changes in behavior for the user?

  • Backend classes removed.
  • typing-extensions now a required dependency before 3.11

Related issue number

Fixes #684

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes

@sakosha sakosha changed the title Merge MemoryBackend into MemoryCache, MemcachedBackend into MemcachedCache Merge Caches with Backends Jun 17, 2025
@sakosha sakosha requested a review from Dreamsorcerer June 17, 2025 14:14
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be good to have the relevant changes separately from the typing changes...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also omit the **kwargs TODO?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just leave it as is?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!
see: #1024

# Conflicts:
#	aiocache/backends/valkey.py
key: bytes,
encoding: str = "utf-8",
_conn: Union[_Conn, None] = None,
) -> Union[str, None]: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.
@overload
async def _get(
self, key: bytes, encoding: None, _conn: Union[_Conn, None] = None
) -> Union[bytes, None]: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.
keys: Iterable[bytes],
encoding: str = "utf-8",
_conn: Union[_Conn, None] = None,
) -> list[Union[str, None]]: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.
keys: Iterable[bytes],
encoding: None,
_conn: Union[_Conn, None] = None,
) -> list[Union[bytes, None]]: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.
key: str,
encoding: str = "utf-8",
_conn: Union[_Conn, None] = None,
) -> Union[str, None]: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.
@overload
async def _get(
self, key: str, encoding: None, _conn: Union[_Conn, None] = None
) -> Union[bytes, None]: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.
keys: list[str],
encoding: str = "utf-8",
_conn: Union[_Conn, None] = None,
) -> list[Union[str, None]]: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.
keys: list[str],
encoding: None,
_conn: Union[_Conn, None] = None,
) -> list[Union[bytes, None]]: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.
@sakosha
Copy link
Author

sakosha commented Jun 27, 2025

superseded by #1024

@sakosha sakosha closed this Jun 27, 2025
@sakosha sakosha deleted the master branch July 4, 2025 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge cache implementation classes for each backend

2 participants