Skip to content

Restrict decorating async methods with sync enignes of Redis, Mongo and SQL cores#336

Merged
shaypal5 merged 25 commits intopython-cachier:masterfrom
gencurrent:feat/restrict-incogrous-decorations
Feb 17, 2026
Merged

Restrict decorating async methods with sync enignes of Redis, Mongo and SQL cores#336
shaypal5 merged 25 commits intopython-cachier:masterfrom
gencurrent:feat/restrict-incogrous-decorations

Conversation

@gencurrent
Copy link
Contributor

@gencurrent gencurrent commented Feb 15, 2026

WARNING :: This branch/PR requires Mongo wire 8 and above, while only Mongo wire 7 is supported in this GH CI configuration.
Primary: raise exception on decorating an async function if the sync client is provided with Redis, SQL and Mongo clients. The reason: sync clients / sessionmakers almost completely wipe benefits of caching results of async functions, especially, over OS protocols, while the codebase becomes simpler without overhead isawaitable checks.
Secondary:

  1. Add conftest.py and clients.py files in the cores testing packages.
  2. Extra tests covering compatibility between async functions and sync engine clients, and vice versa.
  3. Cores sync/async support table is added to README.rst (https://github.com/gencurrent/cachier/tree/feat/restrict-incogrous-decorations?tab=readme-ov-file#id34).

@gencurrent gencurrent requested a review from shaypal5 as a code owner February 15, 2026 02:10
@shaypal5 shaypal5 merged commit 85539dc into python-cachier:master Feb 17, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants