Python: RedisCollection.ensure_collection_deleted can return successfully without deleting the index
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 65/100
調査の方向性
The issue is in python/semantic_kernel/connectors/redis.py. Look at the ensure_collection_deleted method and its dependency on collection_exists. First, run the existing tests for the Redis connector to understand the current behavior. Then, examine the redis-py library documentation or source to find the exact exception type raised by FT.DROPINDEX when an index does not exist. The fix should mirror the pattern in chroma.py: attempt dropindex directly and handle the specific 'index not found' exception quietly, raising a VectorStoreOperationException for other errors. Write a test that simulates a timeout during FT.INFO to verify the fix.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
RedisCollection.ensure_collection_deleted can return successfully without deleting anything.
# python/semantic_kernel/connectors/redis.py
async def collection_exists(self, **kwargs) -> bool:
try:
await self.redis_database.ft(self.collection_name).info()
return True
except Exception:
return False
async def ensure_collection_deleted(self, **kwargs) -> None:
exists = await self.collection_exists()
if exists:
await self.redis_database.ft(self.collection_name).dropindex(**kwargs)
else:
logger.debug("Collection does not exist, skipping deletion.")
collection_exists() reaches Redis to answer, so it can fail for reasons unrelated to whether the index is there - a timeout, an authentication failure, an unreachable node. Every one of those returns False, and ensure_collection_deleted then logs at debug level and returns normally.
The caller is told the collection is deleted. It is not. Nothing raises and nothing is logged above debug.
The same library already does this correctly
ChromaCollection.ensure_collection_deleted in python/semantic_kernel/connectors/chroma.py distinguishes the two cases:
try:
self.client.delete_collection(name=self.collection_name)
except ValueError:
logger.info(f"Collection {self.collection_name} could not be deleted because it doesn't exist.")
except Exception as e:
raise VectorStoreOperationException(
f"Failed to delete collection {self.collection_name} with error: {e}"
) from e
Absent is handled quietly. Anything else raises. That is the behaviour I would expect from ensure_collection_deleted on any connector, and the Redis one is the odd one out.
ChromaCollection.collection_exists has the same except Exception: return False shape, but its delete path does not depend on it, so the consequence there is smaller.
To reproduce
Call ensure_collection_deleted() on a RedisCollection while Redis is reachable at connect time but the FT.INFO call fails - a timeout is the easiest to induce. The method returns without raising and the index is still present.
Expected behavior
A failed check is not an absent collection. ensure_collection_deleted should either delete the index or raise.
Suggested fix
Mirror the Chroma connector: attempt dropindex and handle only the specific "index does not exist" error quietly, raising VectorStoreOperationException for anything else.
I am filing this rather than opening a pull request because the right fix depends on exactly which exception FT.DROPINDEX raises for a missing index in the redis-py version this pins, and I did not want to assert that without a Redis instance to confirm it against. If a maintainer can confirm the exception type, I am happy to open the PR.
Platform
Python, main as of 23 September 2026.
- 主要言語
- C#
- スター
- 28.6k
- フォーク
- 4.8k
- 平均マージ
- 13時間 24分
- マージ済み PR(30日)
- 11
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/semantic-kernel のほかの issue
-
python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
microsoft/semantic-kernel#14491 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microsoft/semantic-kernel#14490 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Python: [Python] structured_outputs_transform reuses ChatHistory across calls (prompt pollution)オープンpython triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
microsoft/semantic-kernel#14483 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
.NET python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
microsoft/semantic-kernel#14482 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
microsoft/semantic-kernel#14481 ·
メンテナーはふだん 2 日以内に返信
microsoft/semantic-kernel の issue をすべて見る
似ている issue
-
[Simple] NavigationBar primary commands do not render AppBarButton.Content when it is a UIElementオープンcontrol/navigationbar kind/bug triage/untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
unoplatform/uno.toolkit.ui#1652 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
microsoft/copilot-camp#1053 ·
メンテナーはふだん 1 日以内に返信
-
bug effort:S P3
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
nightscout/nocturne#1861 ·
メンテナーはふだん 1 日以内に返信
-
agentic-workflows area/Docs partner/agentic-workflows
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/fluentui-blazor#5364 ·
メンテナーはふだん 1 日以内に返信