fix(cli): make module_list check robust to bytes/str key types#67
fix(cli): make module_list check robust to bytes/str key types#67gkorland wants to merge 1 commit into
module_list check robust to bytes/str key types#67Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 23 minutes and 7 seconds.Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #67 +/- ##
==========================================
- Coverage 89.50% 89.35% -0.16%
==========================================
Files 9 9
Lines 610 620 +10
==========================================
+ Hits 546 554 +8
- Misses 64 66 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Copilot Code ReviewFiles: Both use Fix: Use |
Agent Review SummaryIssue AddressedAddressed the medium-severity review comment from @gkorland:
Fix AppliedRemoved the Commit: 89b09be CI Status✅ All checks passed (CodeQL × 2, CodeRabbit, Codecov) Pre-existing test noteThe integration tests in |
`bulk_insert` indexed each module entry with the bytes key `b"name"`, while `bulk_update` used the str key `"name"`. The actual key type depends on the underlying redis-py client's `decode_responses` setting, so one of the two would silently fail to detect the FalkorDB module if client configuration changed. Normalise both code paths to look up the name with either key type and decode bytes to str before comparison. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
89b09be to
c68dcd4
Compare
Summary
The two CLIs disagreed on the key type used to look up module names returned by Redis:
bulk_insert.pyusedm[b"name"]andb"graph" not in module_list.bulk_update.pyusedm["name"]and"graph" not in module_list.Whether the key comes back as
bytesorstrdepends on the underlying redis-py client'sdecode_responsessetting, which is not guaranteed to stay consistent across redis-py / falkordb-py versions. If the configuration changed, one of the two CLIs would silently stop detecting the module and either crash with aKeyErroror always print "module not loaded".Changes
m.get(b"name", m.get("name"))) and decodebytestostrbefore comparing against"graph".Testing
Lint clean (
flake8,black).Memory / Performance Impact
N/A.
Related Issues
From the comprehensive code-review report (BUG-14).