Skip to content

Python: Fix OracleCollection search with multiple filters - #14541

Open
PRABHU KIRAN VANDRANKI (VANDRANKI) wants to merge 1 commit into
microsoft:mainfrom
VANDRANKI:fix/oracle-multiple-filters
Open

PRABHU KIRAN VANDRANKI (VANDRANKI) wants to merge 1 commit into
microsoft:mainfrom
VANDRANKI:fix/oracle-multiple-filters

Conversation

@VANDRANKI

Copy link
Copy Markdown

Motivation and Context

OracleCollection._inner_search_vector only handled a single filter. With a list of filters, _build_filter returns a list of (sql, binds) tuples and the code raised AttributeError: 'tuple' object has no attribute 'values'. Each filter was also parsed with its own BindCounter, so bind names would have collided (:bind_val1 in every filter).

Fixes #14539

Description

Override _build_filter in OracleCollection so all filters share one BindCounter and are combined with AND into one (sql, binds) tuple, as VectorSearchOptions documents. A single filter returns the same tuple as before.

Added two tests in test_oracle.py: multiple filters (fails on main with the AttributeError) and a single filter regression check.

Checked locally: tests/unit/connectors/memory/test_oracle.py passes, ruff check and format are clean, mypy is clean on oracle.py. No database was needed, the tests build the query only.

Contribution Checklist

Copilot AI balanced review requested due to automatic review settings October 4, 2026 20:44
@semantic-kernel-automation semantic-kernel-automation Bot added the python Pull requests for the Python Semantic Kernel label Oct 4, 2026

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 review overview

🟢 Approval recommended

The focused implementation resolves both filter composition and bind-name collisions with appropriate regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes Oracle vector searches using multiple filters by combining them with AND and generating unique bind names.

Changes:

  • Adds Oracle-specific multi-filter construction with a shared bind counter.
  • Adds single- and multi-filter regression tests.
File Description
python/​semantic_kernel/​connectors/​oracle.py Combines filters and binds safely.
python/​tests/​unit/​connectors/​memory/​test_oracle.py Covers single and multiple filters.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch was successfully deployed

1 active deployment
github-app-auth — 88a1c332 Deployed Oct 4, 2026 by VANDRANKI via team_check #581
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests for the Python Semantic Kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: OracleCollection vector search raises AttributeError when filter is a list of multiple filters

2 participants