Skip to content

Python: preserve native keys in filtered vector delete tools - #8535

Open
Sunhy (Shy7777) wants to merge 1 commit into
microsoft:mainfrom
Shy7777:fix/vector-delete-native-keys
Open

Sunhy (Shy7777) wants to merge 1 commit into
microsoft:mainfrom
Shy7777:fix/vector-delete-native-keys

Conversation

@Shy7777

Copy link
Copy Markdown
Contributor

Motivation & Context

A filtered delete tool fails on MongoDB collections with ObjectId keys, even though deleting the same key without a filter works. The filtered path converts retrieved keys to JSON strings and passes them straight to the connector, which expects native keys.

Description & Review Guide

  • What are the major changes? Convert matched keys back through the collection's existing key_from_json hook before deletion. Add a MongoDB regression covering a matching subset, a mapped tenant field, and an empty match.
  • What is the impact of these changes? Filtered deletion works with native key types while processed_keys remains JSON-compatible. Public APIs, approval settings, and filtering behavior are unchanged. The matching regression fails on the base revision; the fix passes 113 MongoDB unit tests and 385 core vector/in-memory tests. Changed-file lint, formatting, and source type checking also pass. Live database integration tests were not run.
  • What do you want reviewers to focus on? Whether the native-key conversion belongs at this point between filtered retrieval and deletion, and whether the regression covers the connector interaction adequately.

Related Issue

Fixes #8534

No other open PR was found for this issue.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
    • All 498 related unit tests pass locally; the full repository matrix remains for CI.
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI balanced review requested due to automatic review settings September 18, 2026 16:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Bug]: Filtered vector delete tools reject MongoDB ObjectId keys

2 participants