Skip to content

fix incorrect namespacing applied to Redis hash field keys #765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

2ykwang
Copy link
Member

@2ykwang 2ykwang commented Mar 8, 2025

This changes addresses an issue where namespacing was applied to the field instead of the key.

behavior:

  • before: Namespacing was applied to the field parameter (e.g, hash key) when it should have been applied to the key parameter.
  • after: Namespacing is correctly applied to the key parameter, leaving the field name unaltered.

@2ykwang 2ykwang added the bug label Mar 8, 2025
@2ykwang 2ykwang requested a review from WisdomPill March 8, 2025 08:43
@2ykwang 2ykwang self-assigned this Mar 8, 2025
Copy link

codecov bot commented Mar 8, 2025

Codecov Report

Attention: Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.

Project coverage is 38.0%. Comparing base (f9f5d0c) to head (a3a4665).
Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
django_redis/client/default.py 63.7% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #765     +/-   ##
========================================
+ Coverage    37.9%   38.0%   +0.1%     
========================================
  Files          44      44             
  Lines        3253    3257      +4     
  Branches      244     244             
========================================
+ Hits         1231    1235      +4     
  Misses       1778    1778             
  Partials      244     244             
Flag Coverage Δ
mypy 38.0% <63.7%> (+0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@2ykwang
Copy link
Member Author

2ykwang commented Mar 10, 2025

should I look into something specific about the GitHub CI failure? @WisdomPill

@WisdomPill
Copy link
Member

hello @2ykwang,

thanks for your contribution!

so only changelog and ruff are left to fix:

  • changelog needs a file called changelog.d/765.bugfix because this PR is number 765 and its reason is a bug fix, inside the file write a description of what the PR is fixing, this will later be put into the changelog when releasing automatically with towncrier
  • as for ruff you can remove ANN101 and add A004 here and it will solve itself

@2ykwang
Copy link
Member Author

2ykwang commented Mar 11, 2025

I’ve added the changelog @WisdomPill

Copy link
Member

@WisdomPill WisdomPill left a comment

Choose a reason for hiding this comment

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

LGTM, I wonder how tests didn't break. Could you try using different version and checking the key in the tests?

Also please fix ruff's error

@WisdomPill
Copy link
Member

also FYI, there's no need to mention me in a comment, just ask for a review, I will see the notifications and I will be happy to review 😄

@2ykwang
Copy link
Member Author

2ykwang commented Mar 12, 2025

LGTM, I wonder how tests didn't break. Could you try using different version and checking the key in the tests?

because hset, hexists, and all other methods that require keys use the same namespacing logic via make_key, ensuring consistent key generation.
and there are no test cases that specifically verify the namespacing of hash key name

@2ykwang 2ykwang force-pushed the fix-hash-cache-key branch 3 times, most recently from e87f1bb to a3e4b2a Compare March 12, 2025 14:20
Updated the ruff lint.ignore settings to include inline documentation links for each ignored rule.
Also added "A004", "A005"
@2ykwang 2ykwang force-pushed the fix-hash-cache-key branch from a3e4b2a to a3a4665 Compare March 12, 2025 14:21
@2ykwang 2ykwang requested review from WisdomPill and removed request for WisdomPill March 12, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants