Skip to content
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

fix: all_pks() for complex keys #471

Merged
merged 6 commits into from
Feb 12, 2023
Merged

Conversation

YaraslauZhylko
Copy link
Contributor

Description

HashModel.all_pks() and JsonModel.all_pks() return only the last part of the Redis key after the last colon (:) instead of full key without the global/modal prefixes.

This only makes difference when we use colons in the primary keys. E.g.:

  • Global prefix: location
  • Model prefix: city
  • Primary key: ca:qc:montreal
  • Full Redis key: location:city:ca:qc:montreal
  • Expected result of all_pks: ca:qc:montreal
  • Actual result of all_pks: montreal

See related Issue fro details.

Related issues

@YaraslauZhylko YaraslauZhylko changed the title fix: all_pks for complex keys fix: all_pks() for complex keys Feb 2, 2023
@codecov-commenter
Copy link

codecov-commenter commented Feb 2, 2023

Codecov Report

Base: 78.85% // Head: 78.92% // Increases project coverage by +0.07% 🎉

Coverage data is based on head (f5c6ada) compared to base (721f734).
Patch coverage: 100.00% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #471      +/-   ##
==========================================
+ Coverage   78.85%   78.92%   +0.07%     
==========================================
  Files          14       14              
  Lines        1173     1177       +4     
==========================================
+ Hits          925      929       +4     
  Misses        248      248              
Flag Coverage Δ
unit 78.92% <100.00%> (+0.07%) ⬆️

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

Impacted Files Coverage Δ
aredis_om/model/model.py 87.07% <100.00%> (+0.05%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@YaraslauZhylko YaraslauZhylko marked this pull request as ready for review February 2, 2023 17:44
@dvora-h dvora-h added the bug Something isn't working label Feb 12, 2023
@dvora-h
Copy link
Contributor

dvora-h commented Feb 12, 2023

Fixes #470

@dvora-h dvora-h merged commit 412bdd6 into redis:main Feb 12, 2023
@YaraslauZhylko YaraslauZhylko deleted the fix/all-pks branch February 12, 2023 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants