Repository navigation
Recurse through nested lists and tuples during deep rename and remove - #616
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #616 +/- ##
==========================================
- Coverage 98.52% 98.51% -0.01%
==========================================
Files 64 64
Lines 2437 2429 -8
==========================================
- Hits 2401 2393 -8
Misses 36 36
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hi @xiehuanyi,
thank you for this PR, the fix is clean and I like that it also removes the duplicated code.
I have only one request before merging: remove(..., deep=True) in benedict/core/remove.py has exactly the same limitation (it only looks one list/tuple level deep). If we fix only rename, the two methods will behave differently.
Could you apply the same fix to remove too, with a couple of unit tests?
Thank you!
834588a to
0d0d91b
Compare
rename(..., deep=True)andremove(..., deep=True)previously skipped dictionaries below another list or tuple, such as{ "users": [[{ "password": "secret" }]] }. Give both operations a recursive visitor for sequence elements while retaining top-level keypath handling and literal nested-key matching.Validation: both new nested-sequence removal cases fail before the removal change. The core/dictionary suites pass with 798 tests, 61 subtests and one existing skip. Every configured pre-commit hook passes, including Mypy. The branch is rebased onto current main. AI-assisted implementation and verification.