fix(local): flatten arrays selected by [] and [i] in payload paths - #1474
IncognitoQuack wants to merge 1 commit into
Conversation
value_by_key flattens an array value one level when the path ends in a
key, but not when it ends in `[]` or `[i]`. With {"a": [[1, 2], [3]]},
"a" resolves to [[1, 2], [3]] while "a[0]" resolved to [[1, 2]] instead
of [1, 2], so a filter on "a[0]" or "a[]" never matched the elements.
The server applies the same one-level flattening to every value a path
selects, whatever the last path item is, so filters, facet and order_by
on such paths returned different points in local mode. Flatten the
values selected by `[]` and `[i]` the same way.
✅ Deploy Preview for poetic-froyo-8baba7 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe payload extractor now uses a shared helper to collect values for final dict keys, wildcard indices, and concrete indices. The helper flattens list values when Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The array-selection change is mergeable after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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. Comment |
value_by_key flattens an array value one level when the path ends in a key, but not when it ends in
[]or[i]. With {"a": [[1, 2], [3]]}, "a" resolves to [[1, 2], [3]] while "a[0]" resolved to [[1, 2]] instead of [1, 2], so a filter on "a[0]" or "a[]" never matched the elements.The server applies the same one-level flattening to every value a path selects, whatever the last path item is, so filters, facet and order_by on such paths returned different points in local mode. Flatten the values selected by
[]and[i]the same way.All Submissions:
devbranch. Did you create your branch fromdev?New Feature Submissions:
pre-commitwithpip3 install pre-commitand set up hooks withpre-commit install?Changes to Core Features: