Skip to content

Preserve call arguments when bypassing the cache - #401

Open
xiehuanyi wants to merge 2 commits into
python-cachier:masterfrom
xiehuanyi:bugfix/preserve-bypass-call-arguments
Open

xiehuanyi wants to merge 2 commits into
python-cachier:masterfrom
xiehuanyi:bugfix/preserve-bypass-call-arguments

Conversation

@xiehuanyi

Copy link
Copy Markdown

When a call uses cachier__skip_cache=True, or caching is disabled globally, the wrapper calls the function with its normalized cache-key arguments. Positional-only arguments are then passed as keywords and raise TypeError; variadic arguments are dropped or arrive as synthetic __varargs_*__ keywords.

Call the original function with its positional arguments and user keyword arguments in both the synchronous and asynchronous bypass paths. The regression tests cover per-call and global bypass, positional-only parameters, variadic parameters, and bound methods.

Addresses the bypass-call issue in #367.

Validation on Python 3.12:

  • New regressions: 12 failed before the fix, 12 passed afterward.
  • Regression and existing variadic tests: 80 passed.
  • Complete local-backend suite: 368 passed, 6 skipped (optional Prometheus dependency), 137 external-backend cases deselected.
  • ruff check . and format checks: passed.
  • CI-configured mypy 2.1.0 with its default hook arguments: no issues in 19 source files.

External MongoDB, Redis, PostgreSQL and S3 services were not run locally. Prepared and verified with Codex assistance.

@xiehuanyi
xiehuanyi requested a review from shaypal5 as a code owner October 11, 2026 07:36
Copilot AI balanced review requested due to automatic review settings October 11, 2026 07:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

2 participants