Skip to content

fix(local): flatten arrays selected by [] and [i] in payload paths - #1474

Open
IncognitoQuack wants to merge 1 commit into
qdrant:devfrom
IncognitoQuack:fix/local-nested-array-path-values
Open

IncognitoQuack wants to merge 1 commit into
qdrant:devfrom
IncognitoQuack:fix/local-nested-array-path-values

Conversation

@IncognitoQuack

Copy link
Copy Markdown

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:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you installed pre-commit with pip3 install pre-commit and set up hooks with pre-commit install?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

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.
@netlify

netlify Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for poetic-froyo-8baba7 ready!

Name Link
🔨 Latest commit 5855193
🔍 Latest deploy log https://app.netlify.com/projects/poetic-froyo-8baba7/deploys/6ab373d54c88670008107e87
😎 Deploy Preview https://deploy-preview-1474--poetic-froyo-8baba7.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Review in Change Stack →

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 13c5ad95-379b-4cac-bc9b-f828d4f32a82

📥 Commits

Reviewing files that changed from the base of the PR and between bdee947 and 5855193.

📒 Files selected for processing (3)
  • qdrant_client/local/payload_value_extractor.py
  • qdrant_client/local/tests/test_payload_utils.py
  • tests/congruence_tests/test_complex_filters.py

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The 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 flat=True and appends values otherwise. Tests cover flattened and nested results for nested array selections. A congruence test compares local and remote filter results for array-selected keys across four condition types and payloads with varied nesting.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: joein

Merge Risk: ⚪ Minimal · up to 58551

The array-selection change is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: flattening arrays selected by [] and [i] in local payload paths.
Description check ✅ Passed The description directly explains the local and server behavior mismatch, the affected payload paths, and the intended fix. It also references relevant tests and validation items.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant